Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
8dbfd1f
Prepared base taking code from an example
Bernardo-MG Sep 18, 2016
9a63457
Corrected setup configuration
Bernardo-MG Sep 18, 2016
6b09ed8
Corrected packages path
Bernardo-MG Sep 18, 2016
ef36691
Corrected coverage package
Bernardo-MG Sep 18, 2016
efce14e
Corrected package declarations
Bernardo-MG Sep 18, 2016
3d14e6a
Corrected coverage package
Bernardo-MG Sep 18, 2016
d743dff
Corrected formatting
Bernardo-MG Sep 18, 2016
a232a4b
Style corrections
Bernardo-MG Sep 18, 2016
5eb80f7
Changed coverage package
Bernardo-MG Sep 18, 2016
1d99cc0
Changed coverage package
Bernardo-MG Sep 18, 2016
a648a9c
Removed package specification for coverage
Bernardo-MG Sep 18, 2016
be17f72
Changed back package name
Bernardo-MG Sep 18, 2016
90d585f
Changed coverage test package
Bernardo-MG Sep 18, 2016
1790930
Changed again package name
Bernardo-MG Sep 18, 2016
cccc9c0
Added dice classes
Bernardo-MG Oct 12, 2016
c82ae71
Added dice classes
Bernardo-MG Oct 12, 2016
5892089
The test now tries to import from the new package nae
Bernardo-MG Oct 12, 2016
0660586
Corrected theme
Bernardo-MG Oct 12, 2016
ce2aeef
Corrected test
Bernardo-MG Oct 12, 2016
27b16ae
Merge pull request #2 from Bernardo-MG/package_name
Bernardo-MG Oct 12, 2016
8ad492a
Added tests for the Dice class
Bernardo-MG Oct 12, 2016
6b17e0a
Corrected range error
Bernardo-MG Oct 12, 2016
5713974
Changed landscape URL
Bernardo-MG Oct 12, 2016
3c57885
Changed coverage config
Bernardo-MG Oct 12, 2016
bddf3f2
Updated theme
Bernardo-MG Oct 12, 2016
720f1d3
Prepared a basic dice parser
Bernardo-MG Oct 13, 2016
08e7a8a
Corrected imports
Bernardo-MG Oct 13, 2016
6b6c033
Code corrections
Bernardo-MG Oct 13, 2016
95fb751
Added script to build docs
Bernardo-MG Oct 13, 2016
86296e7
Installs Sphinx
Bernardo-MG Oct 13, 2016
d86ec25
Installs the project dependencies
Bernardo-MG Oct 14, 2016
625c08d
Reorganized parser classes
Bernardo-MG Oct 16, 2016
f77d318
The dice parser is now based in nodes
Bernardo-MG Oct 16, 2016
f0aab01
The constant node overrides more operators
Bernardo-MG Oct 16, 2016
575ce4a
Simplified operations with numbers
Bernardo-MG Oct 16, 2016
3a1821b
Added tests for binary operations with dice
Bernardo-MG Oct 16, 2016
de1306a
Added mixed operands tests
Bernardo-MG Oct 16, 2016
741b742
The dice node is now also a dice
Bernardo-MG Oct 16, 2016
11e1c98
Grouped parser tests
Bernardo-MG Oct 16, 2016
45a5282
Corrected code checking tests tested package
Bernardo-MG Oct 16, 2016
32ec62b
Formatted code
Bernardo-MG Oct 16, 2016
5f35082
Formatted code
Bernardo-MG Oct 16, 2016
9154a74
Fixed a hidden variable style error
Bernardo-MG Oct 16, 2016
8c6c965
Added dice test cases
Bernardo-MG Oct 16, 2016
ccff2e0
Added dice test cases
Bernardo-MG Oct 16, 2016
5448a13
Implemented string conversion methods
Bernardo-MG Oct 16, 2016
7d8d03f
Added more test cases
Bernardo-MG Oct 17, 2016
dfad35d
Fixed the constants being wrapped into multiple nodes
Bernardo-MG Oct 17, 2016
38a174b
Added more test cases
Bernardo-MG Oct 17, 2016
20d133a
Corrected constructors
Bernardo-MG Oct 17, 2016
b53d86f
Corrected operation order
Bernardo-MG Oct 17, 2016
3aacf65
Disabled dubious test
Bernardo-MG Oct 17, 2016
9b8c029
Cleaned up tests and added test cases
Bernardo-MG Oct 17, 2016
7fc6904
Added missing setup
Bernardo-MG Oct 17, 2016
a5e2f4b
Added test cases for invalid inputs
Bernardo-MG Oct 17, 2016
1c6480c
Errors are now logged
Bernardo-MG Oct 18, 2016
1f3734e
Corrected logger message templates usage
Bernardo-MG Oct 18, 2016
2c264a2
Added test cases
Bernardo-MG Oct 18, 2016
c3f40c9
Added test cases
Bernardo-MG Oct 18, 2016
f1aab00
Added docstring
Bernardo-MG Oct 18, 2016
e41b009
Added code documentation to the docs
Bernardo-MG Oct 18, 2016
2927976
Updated scripts
Bernardo-MG Oct 18, 2016
dfc86e6
Corrected line length
Bernardo-MG Oct 18, 2016
6b26a4b
Formatted code
Bernardo-MG Oct 18, 2016
a4fff11
Corrected inheritance problem
Bernardo-MG Oct 18, 2016
5981f67
Code corrections
Bernardo-MG Oct 18, 2016
4229a3a
Removed unused node
Bernardo-MG Oct 18, 2016
c59425a
Corrected ToC
Bernardo-MG Oct 18, 2016
85743b3
Corrected max dice test
Bernardo-MG Oct 18, 2016
831cee3
Prepared docs deployment
Bernardo-MG Oct 20, 2016
a6ad02c
Added sshpass
Bernardo-MG Oct 20, 2016
12c6596
Corrected docs path
Bernardo-MG Oct 20, 2016
7da109d
Changed docs badges URLs
Bernardo-MG Oct 21, 2016
cbe151c
Updated theme
Bernardo-MG Oct 21, 2016
540f62a
Added docstrings
Bernardo-MG Oct 21, 2016
02c9d5b
Added docstrings
Bernardo-MG Oct 21, 2016
f06260a
Added more code documentation
Bernardo-MG Oct 21, 2016
0a2f4c7
Corrected code index
Bernardo-MG Oct 21, 2016
f02e826
Corrected doc links
Bernardo-MG Oct 21, 2016
a51c19d
Corrected Github links
Bernardo-MG Oct 21, 2016
2c4c71b
The dice parser can now be imported from the parser package
Bernardo-MG Oct 22, 2016
ca4dc26
Added a sample executable
Bernardo-MG Oct 22, 2016
3d1ce3e
Added usage example in the readme
Bernardo-MG Oct 22, 2016
0c7e87c
Improved features list
Bernardo-MG Oct 22, 2016
558a6f2
Added usage example
Bernardo-MG Oct 22, 2016
6df688f
Reformatted
Bernardo-MG Oct 22, 2016
27bd922
Changed the format of the example code
Bernardo-MG Oct 22, 2016
7c4d9d6
Corrected code blocks format
Bernardo-MG Oct 22, 2016
12909c5
Added documentation for the dice classes
Bernardo-MG Oct 22, 2016
0810cb2
Added documentation for the grammar
Bernardo-MG Oct 22, 2016
8b5e353
Renamed nodes to expressions
Bernardo-MG Oct 22, 2016
f65b1a0
Corrected docs for the notation
Bernardo-MG Oct 22, 2016
612b862
Renamed expression classes and prepared docs for them
Bernardo-MG Oct 22, 2016
b3eaa4d
Added docs for notation classes.
Bernardo-MG Oct 22, 2016
32bc232
Added docs for the parser
Bernardo-MG Oct 22, 2016
1e3a6e5
Raised version
Bernardo-MG Oct 22, 2016
1cbc7d6
Formatted code
Bernardo-MG Oct 22, 2016
5daa11f
Invalid values now return none
Bernardo-MG Oct 22, 2016
5a513bf
Formatted tests
Bernardo-MG Oct 22, 2016
93b8d45
Reorganized tests
Bernardo-MG Oct 22, 2016
7a1a1cc
Corrected rolled arguments validation
Bernardo-MG Oct 22, 2016
c4d2e4e
Corrected rolled arguments validation
Bernardo-MG Oct 22, 2016
458c3e0
Corrected rolled arguments validation
Bernardo-MG Oct 22, 2016
923a810
Corrected test docstrings
Bernardo-MG Oct 23, 2016
6a1eddc
Added license information
Bernardo-MG Oct 23, 2016
77ee876
Corrected tests docstring and cleaned up tests
Bernardo-MG Oct 23, 2016
c9f3c56
Corrected tests
Bernardo-MG Oct 23, 2016
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added dice test cases
  • Loading branch information
Bernardo-MG committed Oct 16, 2016
commit ccff2e01ab89b9feab1ec2d1a10e2f8a3ae75f53
34 changes: 26 additions & 8 deletions tests/parser/test_dice_parser_dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,50 @@ def test_simpleDice(self):
self.assertEqual(1, dice.quantity)
self.assertEqual(6, dice.sides)

def test_emptyDice(self):
def test_simpleDice_alternativeSeparator(self):
"""
Tests that a simple dice notation can be parsed.
"""
dice = self.parser.parse("0d6")
dice = self.parser.parse("1D6")

self.assertEqual(0, dice.quantity)
self.assertEqual(1, dice.quantity)
self.assertEqual(6, dice.sides)

def test_simpleDice_alternativeSeparator(self):
def test_onesDice(self):
"""
Tests that a simple dice notation can be parsed.
"""
dice = self.parser.parse("1D6")
dice = self.parser.parse("1d1")

self.assertEqual(1, dice.quantity)
self.assertEqual(1, dice.sides)

def test_zeroQuantity(self):
"""
Tests that a simple dice notation can be parsed.
"""
dice = self.parser.parse("0d6")

self.assertEqual(0, dice.quantity)
self.assertEqual(6, dice.sides)

def test_minimalDice(self):
def test_zeroSides(self):
"""
Tests that a simple dice notation can be parsed.
"""
dice = self.parser.parse("1d1")
dice = self.parser.parse("1d0")

self.assertEqual(1, dice.quantity)
self.assertEqual(1, dice.sides)
self.assertEqual(0, dice.sides)

def test_zerosDice(self):
"""
Tests that a simple dice notation can be parsed.
"""
dice = self.parser.parse("0d0")

self.assertEqual(0, dice.quantity)
self.assertEqual(0, dice.sides)


class TestDiceBinaryOperation(unittest.TestCase):
Expand Down