Skip to content

Commit

Permalink
use package prefix to run unittests at the root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjoon-lee committed Jan 9, 2024
1 parent db5b039 commit 5663734
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: cd carnot && python -m unittest
run: python -m unittest
6 changes: 3 additions & 3 deletions carnot/beaconized_carnot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Set

from carnot import Carnot, Block, TimeoutQc, Vote, Event, Send, Quorum
from beacon import *
from overlay import EntropyOverlay
from carnot.carnot import Carnot, Block, TimeoutQc, Vote, Event, Send, Quorum
from carnot.beacon import *
from carnot.overlay import EntropyOverlay

@dataclass
class BeaconizedBlock(Block):
Expand Down
2 changes: 1 addition & 1 deletion carnot/overlay.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import random
from abc import abstractmethod
from typing import Set, Optional, List, Self
from carnot import Overlay, Id, Committee, View
from carnot.carnot import Overlay, Id, Committee, View


class EntropyOverlay(Overlay):
Expand Down
2 changes: 1 addition & 1 deletion carnot/test_beacon_verification.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Tuple
from unittest import TestCase

from beacon import *
from carnot.beacon import *
from random import randint


Expand Down
10 changes: 5 additions & 5 deletions carnot/test_beaconized_carnot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

from blspy import PrivateKey

from carnot import Id, Carnot, Block, Overlay, Vote, StandardQc, NewView
from beacon import generate_random_sk, RandomBeacon, NormalMode, RecoveryMode
from beaconized_carnot import BeaconizedCarnot, BeaconizedBlock
from overlay import FlatOverlay, EntropyOverlay
from test_unhappy_path import parents_from_childs
from carnot.carnot import Id, Carnot, Block, Overlay, Vote, StandardQc, NewView
from carnot.beacon import generate_random_sk, RandomBeacon, NormalMode, RecoveryMode
from carnot.beaconized_carnot import BeaconizedCarnot, BeaconizedBlock
from carnot.overlay import FlatOverlay, EntropyOverlay
from carnot.test_unhappy_path import parents_from_childs


def gen_node(sk: PrivateKey, overlay: Overlay, entropy: bytes = b""):
Expand Down
2 changes: 1 addition & 1 deletion carnot/test_happy_path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from carnot import *
from carnot.carnot import *
from unittest import TestCase


Expand Down
2 changes: 1 addition & 1 deletion carnot/test_tree_overlay.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import TestCase

from tree_overlay import CarnotOverlay, CarnotTree
from carnot.tree_overlay import CarnotOverlay, CarnotTree


class TestCarnotTree(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion carnot/test_unhappy_path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from carnot import *
from carnot.carnot import *
from unittest import TestCase
from itertools import chain

Expand Down
4 changes: 2 additions & 2 deletions carnot/tree_overlay.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import itertools
from hashlib import blake2b
from typing import List, Dict, Tuple, Set, Optional, Self
from carnot import Id, Committee
from overlay import EntropyOverlay
from carnot.carnot import Id, Committee
from carnot.overlay import EntropyOverlay
import random


Expand Down

0 comments on commit 5663734

Please sign in to comment.