Use package prefix to run unittests at the root dir (#41)

This commit is contained in:
Youngjoon Lee 2024-01-10 10:23:03 +09:00 committed by GitHub
parent 6f0e8a95c0
commit 8be2750c75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 18 deletions

View File

@ -9,11 +9,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: cd carnot && python -m unittest
run: python -m unittest

View File

@ -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):

View File

@ -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):

View File

@ -1,7 +1,7 @@
from typing import Tuple
from unittest import TestCase
from beacon import *
from carnot.beacon import *
from random import randint

View File

@ -5,11 +5,11 @@ from itertools import chain
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""):

View File

@ -1,4 +1,4 @@
from carnot import *
from carnot.carnot import *
from unittest import TestCase

View File

@ -1,6 +1,6 @@
from unittest import TestCase
from tree_overlay import CarnotOverlay, CarnotTree
from carnot.tree_overlay import CarnotOverlay, CarnotTree
class TestCarnotTree(TestCase):

View File

@ -1,4 +1,4 @@
from carnot import *
from carnot.carnot import *
from unittest import TestCase
from itertools import chain

View File

@ -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