Skip to content

Commit

Permalink
improve style
Browse files Browse the repository at this point in the history
i left some "issues" in there cuz it still works fine and it would be worse to read/understand OR i think its unnecessary

anyway it should be ready to release to pypi :]
  • Loading branch information
Wo0fle committed Jun 19, 2024
1 parent 83160bc commit 66ab31b
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 74 deletions.
14 changes: 11 additions & 3 deletions TEST_virtual_sq1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
import pytest


# im pretty sure i tested every typical case soooo basically if something fails then thats a skill issue :]
# im pretty sure i tested every typical case
# soooo basically if something fails then thats a skill issue :]

@pytest.fixture
def sq1():
return Square1()


def test_apply_alg(sq1):
sq1.apply_alg("13/0,9/ -1,0) / ignore this text (3,0) / 1 / 0,3/-1,0 / (-3,/")
sq1.apply_alg("13/0,9/ -1,0)/ ignore this text (3,0)/ 1/ 0,3/-1,0 / (-3,/")
assert sq1.__str__() == "A2B3C1D4-5E6F7G8H"


Expand All @@ -23,6 +24,7 @@ def test_apply_state_with_slash(sq1):
sq1.apply_state("ABCDEF GH12345678 /")
assert sq1.__str__() == "ABCDEF/GH12345678"


def test_apply_state_with_dash(sq1):
sq1.apply_state("ABCDEF GH12345678 -")
assert sq1.__str__() == "ABCDEF-GH12345678"
Expand All @@ -32,18 +34,22 @@ def test_apply_illegal_alg_too_many_dashes_top(sq1):
sq1.apply_alg("--3/")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"


def test_apply_illegal_alg_too_many_dashes_bottom(sq1):
sq1.apply_alg("0,--3/")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"


def test_apply_illegal_alg_too_many_commas(sq1):
sq1.apply_alg("3,4,5,6")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"


def test_apply_illegal_alg_impossible_top_turn(sq1):
sq1.apply_alg("2")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"


def test_apply_illegal_alg_impossible_bottom_turn(sq1):
sq1.apply_alg("0,-2")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"
Expand All @@ -58,10 +64,12 @@ def test_apply_illegal_state_extra_pieces(sq1):
sq1.apply_state("ABCDEFGHI123456789")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"


def test_apply_illegal_state_missing_pieces(sq1):
sq1.apply_state("ABCDEF1234567")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"


def test_apply_illegal_state_impossible_state(sq1):
sq1.apply_state("1ABCDEFG2345678")
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"
Expand All @@ -70,4 +78,4 @@ def test_apply_illegal_state_impossible_state(sq1):
def test_apply_algs_from_different_initial_states(sq1):
sq1.apply_state("CG216F5B/EHD4A837")
sq1.apply_alg("(3,-1)/ (-2,1)/ (2,-4)/ (-2,-5)/ (0,-3)/ (3,-1)/ (0,-3)/ (3,0)/ (4,-4)/ (6,-2)", True)
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"
assert sq1.__str__() == "A1B2C3D4-5E6F7G8H"
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Topic :: Games/Entertainment :: Puzzle Games',
'Programming Language :: Python',
],
],

py_modules=['virtual_sq1'],

extras_require={'dev':['pytest','coverage']}
)
extras_require={'dev': ['pytest', 'coverage']}
)
Loading

0 comments on commit 66ab31b

Please sign in to comment.