Antoni Segura Puimedon has posted comments on this change.

Change subject: Add unit tests for unified network persistence
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

....................................................
File tests/netconfpersistenceTests.py
Line 33: BONDING_ATTRIBUTES = {'options': 'mode=4 miimon=100', 'nics': ['eth0', 
'eth1']}
Line 34: 
Line 35: 
Line 36: class netConfPersistenceTests(TestCaseBase):
Line 37:     def __init__(self, *args, **kwargs):
Instead of __init__ and __del__ you should be using "setUp" and "tearDown".
Line 38:         TestCaseBase.__init__(self, *args, **kwargs)
Line 39:         self.tempdir = tempfile.mkdtemp()
Line 40:         os.mkdir(os.path.join(self.tempdir, 'nets'))
Line 41:         os.mkdir(os.path.join(self.tempdir, 'bonds'))


Line 48:             filePath = os.path.join(self.tempdir, 'nets', NETWORK)
Line 49:             with open(filePath, 'w') as networkFile:
Line 50:                 json.dump(NETWORK_ATTRIBUTES, networkFile)
Line 51: 
Line 52:             persistence = Config(self.tempdir + os.sep)
Do we really need the os.sep? I'd be cool if Config could do without the 
trailing slash.
Line 53:             self.assertEqual(persistence.networks[NETWORK], 
NETWORK_ATTRIBUTES)
Line 54:         finally:
Line 55:             os.remove(filePath)
Line 56: 


-- 
To view, visit http://gerrit.ovirt.org/21269
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0221f2e0313a80d0ed5ce2d5406dc45f08ab26dd
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amul...@redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com>
Gerrit-Reviewer: Assaf Muller <amul...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to