Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
language: python

python:
- 2.7
- 3.4

install:
pip install --user -r requirements.txt
os: linux
dist: xenial

before_install:
- sudo apt-get install -y python-qt4
- sudo pip install pytest-qt

script:
- pytest
Expand Down
10 changes: 5 additions & 5 deletions equations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ def prepareTextPuzzle(self, maxValue):
# TODO: Add unit test , mandatory
# Stephany has...
relations = {"three more than": (1,3) ,"two more than": (1,2) ,"one more than" : (1,1), "one less than" : (1,-1), "two less than" : (1,-2), "three less than" : (1,-3), "twice as much as" : (2,0), "half of what" : (0.5, 0)}
relation = random.choice(relations.keys())
relation = random.choice(list(relations.keys()))
kasia_items, sum_items = self.computeAnswerAndTotal(relations[relation],maxValue)
return relation, kasia_items, sum_items

Expand Down Expand Up @@ -1274,11 +1274,11 @@ def makeDescriptionOfTextPuzzle(self,sumItems, relationText):
def makeDescriptionOfBuyingPuzzle(self,item, zlotys, groszys):
items = item + "s"
price = ""
if zlotys <> "0":
if zlotys is not "0":
price += zlotys+ " dollars "

if groszys <> "0":
if zlotys <> "0":
if groszys is not "0":
if zlotys is not "0":
price += "and "
price += groszys+ " cents "
self.price = "= "+str(zlotys)+"."+str(groszys)+" $"
Expand Down Expand Up @@ -1344,6 +1344,6 @@ def makeMazeSpeech(self):
config.getMaximumBears(), # some initialization has to be done
config.getContent())
else:
print "Daily limit exhausted"
print("Daily limit exhausted")
stop = Stop(args)
sys.exit(app.exec_())
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

6 changes: 1 addition & 5 deletions test_equations.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,19 @@ def testCalculateSectorIndex(qtbot):
assert(equations.Maze(4,3).calculateSectorIndex(0,4) == "none")

def testMaze(qtbot):
# testMaze = equations.Maze(3,3)
# qtbot.addWidget(testMaze)
# testMaze.show()
# time.sleep(1)
class Args():
def __init__(self):
self.dry_run = "Test"
args = Args()
testStop = equations.Stop(args)
testStop.show()
qtbot.addWidget(testStop)
# qtbot.waitExposed(testStop,1000)
qtbot.waitForWindowShown(testStop)
return

def testClearSectors(qtbot):
testMaze = equations.Maze(3,3)
qtbot.addWidget(testMaze)
refTestMaze = equations.Maze(3,3)
assert(refTestMaze.width == 3)
assert(refTestMaze.height == 3)
Expand Down