@@ 32-41 (lines=10) @@ | ||
29 | self.provenance.log(newfile, 'test', 'testdata/eeg/stub.cnt') |
|
30 | img = self.provenance.get().byLocation(newfile) |
|
31 | ||
32 | def test_Log(self): |
|
33 | self.provenance.discover('testdata') |
|
34 | newfile = 'temp/smoothed.test' |
|
35 | self.touch(newfile) |
|
36 | parent = os.path.abspath('testdata/eeg/stub.cnt') |
|
37 | self.provenance.log(newfile, 'test', parent) |
|
38 | testfpath = os.path.abspath(newfile) |
|
39 | img = self.provenance.get().byLocation(testfpath) |
|
40 | self.assertEqual(img.provenance['subject'], 'Jane Doe') |
|
41 | self.assertEqual(img.provenance['size'], os.path.getsize(newfile)) |
|
42 | ||
43 | def test_Record_with_user(self): |
|
44 | self.provenance.discover('testdata') |
|
@@ 43-51 (lines=9) @@ | ||
40 | self.assertEqual(img.provenance['subject'], 'Jane Doe') |
|
41 | self.assertEqual(img.provenance['size'], os.path.getsize(newfile)) |
|
42 | ||
43 | def test_Record_with_user(self): |
|
44 | self.provenance.discover('testdata') |
|
45 | newfile = 'temp/recorded.test' |
|
46 | self.touch(newfile) |
|
47 | parent = os.path.abspath('testdata/eeg/stub.cnt') |
|
48 | self.provenance.record('echo hallo', newfile, parent, user='007') |
|
49 | testfpath = os.path.abspath(newfile) |
|
50 | img = self.provenance.get().byLocation(testfpath) |
|
51 | self.assertEqual(img.provenance['user'], '007') |
|
52 | ||
53 | def test_Export_Import(self): |
|
54 | from niprov.exceptions import UnknownFileError |