Skip to content

Commit

Permalink
Tweaking the documentation strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dkfellows committed Jun 21, 2018
1 parent f687f65 commit cf16780
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 39 deletions.
21 changes: 7 additions & 14 deletions unittests/tag_tests/test_iptag.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@


class TestingIptag(unittest.TestCase):
"""
TestingIptag
""" Tests of IPTag
"""

def test_create_valid_iptag(self):
"""
test which tests if a iptag with valid inputs works
""" test if an IP tag with valid inputs works
:rtype: None
"""
iptag = IPTag("", 0, 0, 0, "", 1)
self.assertIsNotNone(iptag)

def test_retrival_of_board_address(self):
"""
test if the board address retrieval works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -33,8 +30,7 @@ def test_retrival_of_board_address(self):
self.assertEqual("", board_address)

def test_retrival_of_ip_address(self):
"""
test if the board address retrieval works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -44,8 +40,7 @@ def test_retrival_of_ip_address(self):
self.assertEqual("", ip_address)

def test_retrival_of_tag(self):
"""
test if the board address retrieval works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -55,8 +50,7 @@ def test_retrival_of_tag(self):
self.assertEqual(tag, 0)

def test_retrival_of_port(self):
"""
test if the board address retrieval works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -66,8 +60,7 @@ def test_retrival_of_port(self):
self.assertEqual(port, 1)

def test_retrival_of_strip_sdp(self):
"""
test if the board address retrieval works
""" test if the board address retrieval works
:rtype: None
"""
Expand Down
29 changes: 10 additions & 19 deletions unittests/tag_tests/test_reverse_iptag.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Testingreverseiptag
TestingReverseIptag
"""
from __future__ import absolute_import
# general imports
Expand All @@ -8,22 +8,19 @@


class TestingReverseIptag(unittest.TestCase):
"""
TestingIptag
""" Tests of ReverseIPTag
"""

def test_create_valid_reverse_iptag(self):
"""
test which tests if a iptag with valid inputs works
""" test if a reverse IP tag with valid inputs works
:rtype: None
"""
reverse_ip_tag = ReverseIPTag("", 0, 1, 0, 0, 1)
self.assertIsNotNone(reverse_ip_tag)

def test_retrival_of_board_address(self):
"""
test if the board address retrival works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -33,8 +30,7 @@ def test_retrival_of_board_address(self):
self.assertEqual("", board_address)

def test_retrival_of_tag(self):
"""
test if the board address retrival works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -44,8 +40,7 @@ def test_retrival_of_tag(self):
self.assertEqual(0, tag)

def test_retrival_of_port(self):
"""
test if the board address retrival works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -55,8 +50,7 @@ def test_retrival_of_port(self):
self.assertEqual(port, 1)

def test_retrival_of_dest_x(self):
"""
test if the board address retrival works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -66,8 +60,7 @@ def test_retrival_of_dest_x(self):
self.assertEqual(destination_x, 0)

def test_retrival_of_dest_y(self):
"""
test if the board address retrival works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -77,8 +70,7 @@ def test_retrival_of_dest_y(self):
self.assertEqual(destination_y, 0)

def test_retrival_of_dest_p(self):
"""
test if the board address retrival works
""" test if the board address retrieval works
:rtype: None
"""
Expand All @@ -88,8 +80,7 @@ def test_retrival_of_dest_p(self):
self.assertEqual(destination_p, 1)

def test_retrival_of_sdp_port(self):
"""
test if the board address retrival works
""" test if the board address retrieval works
:rtype: None
"""
Expand Down
3 changes: 1 addition & 2 deletions unittests/test_chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ def test_reserve_a_system_processor(self):
self.assertEquals(count, 1)

def test_get_first_none_monitor_processor(self):
"""
test the get_first_none_monitor_processor
""" test the get_first_none_monitor_processor
NOTE: Not sure if method being tested is required.
"""
Expand Down
4 changes: 2 additions & 2 deletions unittests/test_fixed_route_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def test_fixed_route_creation(self):
def test_fixed_route_errors(self):
with self.assertRaises(SpinnMachineAlreadyExistsException) as e:
FixedRouteEntry([1, 2, 2], [2, 3, 4])
self.assertEqual(e.exception.item, "processor id")
self.assertEqual(e.exception.item, "processor ID")
self.assertEqual(e.exception.value, "2")
with self.assertRaises(SpinnMachineAlreadyExistsException) as e:
FixedRouteEntry([1, 2, 3], [2, 3, 2])
self.assertEqual(e.exception.item, "link id")
self.assertEqual(e.exception.item, "link ID")
self.assertEqual(e.exception.value, "2")


Expand Down
4 changes: 2 additions & 2 deletions unittests/test_multicast_routing_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_creating_new_multicast_routing_entry(self):
self.assertEqual(a_multicast.link_ids, set(link_ids))
self.assertEqual(a_multicast.mask, mask)
self.assertEqual(a_multicast.processor_ids, set(proc_ids))
# While we're here, let's check a few other basic ops
# While we're here, let's check a few other basic operations
self.assertEqual(str(a_multicast),
"1:1:True:{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,"
" 12, 13, 14, 15, 16, 17}:{0, 1, 2, 3, 4, 5}")
Expand All @@ -42,7 +42,7 @@ def test_duplicate_processors_ids(self):
mask = 1
with self.assertRaises(SpinnMachineAlreadyExistsException) as e:
MulticastRoutingEntry(key, mask, proc_ids, link_ids, True)
self.assertEqual(e.exception.item, "processor id")
self.assertEqual(e.exception.item, "processor ID")
self.assertEqual(e.exception.value, "0")

def test_duplicate_link_ids(self):
Expand Down

0 comments on commit cf16780

Please sign in to comment.