Skip to content

Commit

Permalink
Fix coverage calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
martialblog committed Oct 25, 2016
1 parent 047bf59 commit 9e729f7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ install:
- pip install coverage
script:
- python -m unittest discover
- coverage run cheat/cheat.py git
- coverage report -m cheat/cheat.py
- coverage run -m unittest discover
- coverage report -m
after_success:
coveralls
12 changes: 12 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ def setUp(self):
self.exit_1 = 1 << 8
self.exit_2 = 2 << 8

def test_main_list(self):
"""
Lazy testing of the main function.
Checks the exitcode if the list is displayed.
"""

command = '/usr/bin/env python3 cheat/cheat.py --list > /dev/null'
status = os.system(command)

self.assertEqual(status, self.exit_0)


def test_main_success(self):
"""
Lazy testing of the main function.
Expand Down
11 changes: 11 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ def test_print_available_sheets(self):
with patch('sys.stdout', new=StringIO()) as fake_out:
u.print_available_sheets(self.directory)
self.assertEqual(fake_out.getvalue(), expected_output)


def test_colors(self):
"""
Test of the color class
"""

expected_output = "\033[94m"
output = u.colors.DEFAULT

self.assertEqual(output, expected_output)

0 comments on commit 9e729f7

Please sign in to comment.