Skip to content

Commit

Permalink
Correcting the function names in the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KGergo88 committed Jul 5, 2019
1 parent b7bfe55 commit 641a7fb
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 92 deletions.
22 changes: 11 additions & 11 deletions tests/unit_tests/test_memoryEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def setUp(self):
self.addressLength = 0x100
self.addressEnd = 0x1000 + 0x100 - 0x01

def test_ConstructorBasicCase(self):
def test_constructorBasicCase(self):
# Do not use named parameters here so that the order of parameters are also checked
basicEntry = emma_libs.memoryEntry.MemEntry(self.tag, self.vasName, self.vasSectionName, self.section,
self.moduleName, self.mapfileName, self.configID, self.memType,
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_ConstructorBasicCase(self):
self.assertEqual(basicEntry.addressLengthHexOriginal, hex(self.addressLength))
self.assertEqual(basicEntry.addressEndOriginal, hex(self.addressEnd))

def test_ConstructorAddressLengthAndAddressEnd(self):
def test_constructorAddressLengthAndAddressEnd(self):
# Modifying the self.addressEnd to make sure it is wrong
self.addressEnd = self.addressStart + self.addressLength + 0x100
entryWithLengthAndAddressEnd = emma_libs.memoryEntry.MemEntry(tag=self.tag, vasName=self.vasName,
Expand All @@ -90,7 +90,7 @@ def test_ConstructorAddressLengthAndAddressEnd(self):
self.assertEqual(entryWithLengthAndAddressEnd.addressLength, self.addressLength)
self.assertEqual(entryWithLengthAndAddressEnd.addressEnd, (self.addressStart + self.addressLength - 1))

def test_ConstructorDmaEntry(self):
def test_constructorDmaEntry(self):
# Testing the creation of a DMA entry
entryWithDma = emma_libs.memoryEntry.MemEntry(tag=self.tag, vasName=None, vasSectionName=self.vasSectionName,
section=self.section, moduleName=self.moduleName, mapfileName=self.mapfileName,
Expand All @@ -99,7 +99,7 @@ def test_ConstructorDmaEntry(self):
addressEnd=None)
self.assertEqual(entryWithDma.dma, True)

def test_ConstructorNoAddressLengthNorAddressEnd(self):
def test_constructorNoAddressLengthNorAddressEnd(self):
# Testing the creation of a DMA entry
with self.assertRaises(SystemExit) as contextManager:
entryWithoutLengthAndAddressEnd = emma_libs.memoryEntry.MemEntry(tag=self.tag, vasName=self.vasName,
Expand Down Expand Up @@ -339,9 +339,9 @@ def test_constructor(self):

def test___eq__(self):
entryFirst = emma_libs.memoryEntry.ObjectEntry(tag=self.tag, vasName=self.vasName, vasSectionName=self.vasSectionName,
section=self.section, moduleName=self.moduleName, mapfileName=self.mapfileName,
configID=self.configID, memType=self.memType, category=self.category,
addressStart=self.addressStart, addressLength=self.addressLength, addressEnd=None)
section=self.section, moduleName=self.moduleName, mapfileName=self.mapfileName,
configID=self.configID, memType=self.memType, category=self.category,
addressStart=self.addressStart, addressLength=self.addressLength, addressEnd=None)
# Testing with an object that is not a MemEntry
with self.assertRaises(NotImplementedError):
self.assertEqual((8 == entryFirst), False)
Expand All @@ -350,10 +350,10 @@ def test___eq__(self):

# Testing with an object that is equal
entryOther = emma_libs.memoryEntry.ObjectEntry(tag=self.tag, vasName=self.vasName, vasSectionName=self.vasSectionName,
section=self.section, moduleName=self.moduleName,
mapfileName=self.mapfileName, configID=self.configID, memType=self.memType,
category=self.category, addressStart=self.addressStart,
addressLength=self.addressLength, addressEnd=None)
section=self.section, moduleName=self.moduleName,
mapfileName=self.mapfileName, configID=self.configID, memType=self.memType,
category=self.category, addressStart=self.addressStart,
addressLength=self.addressLength, addressEnd=None)
self.assertEqual((entryFirst == entryOther), True)

# Changing one attribute that is important to the __eq__ operation then asserting it whether they are now different
Expand Down
Loading

0 comments on commit 641a7fb

Please sign in to comment.