Code Duplication    Length = 9-10 lines in 2 locations

acceptance/test_contextAPI.py 2 locations

@@ 25-34 (lines=10) @@
22
        with open(path,'w') as tempfile:
23
            tempfile.write('0')
24
25
    def test_Log(self):
26
        self.provenance.discover('testdata')
27
        newfile = 'temp/smoothed.test'
28
        self.touch(newfile)
29
        parent = os.path.abspath('testdata/eeg/stub.cnt')
30
        self.provenance.log(newfile, 'test', parent)
31
        testfpath = os.path.abspath(newfile)
32
        img = self.provenance.get(forFile=testfpath)
33
        self.assertEqual(img.provenance['subject'], 'Jane Doe')
34
        self.assertEqual(img.provenance['size'], os.path.getsize(newfile))
35
36
    def test_Record_with_user(self):
37
        self.provenance.discover('testdata')
@@ 36-44 (lines=9) @@
33
        self.assertEqual(img.provenance['subject'], 'Jane Doe')
34
        self.assertEqual(img.provenance['size'], os.path.getsize(newfile))
35
36
    def test_Record_with_user(self):
37
        self.provenance.discover('testdata')
38
        newfile = 'temp/recorded.test'
39
        self.touch(newfile)
40
        parent = os.path.abspath('testdata/eeg/stub.cnt')
41
        self.provenance.record('echo hallo', newfile, parent, user='007')
42
        testfpath = os.path.abspath(newfile)
43
        img = self.provenance.get(forFile=testfpath)
44
        self.assertEqual(img.provenance['user'], 007)
45
46
    def test_Export_Import(self):
47
        from niprov.exceptions import UnknownFileError