11
11
12
12
class SourceTest (abc .ABC ):
13
13
"""
14
- Test case class used to test a Source implementation. Subclass from and set
15
- the SOURCE property to run tests on that source .
14
+ Test case class used to test a Source implementation. Subclass from and
15
+ implement the setUpSource method .
16
16
17
17
>>> from dffml.source.file import FileSourceConfig
18
18
>>> from dffml.source.json import JSONSource
@@ -95,8 +95,7 @@ async def test_update(self):
95
95
96
96
class FileSourceTest (SourceTest ):
97
97
"""
98
- Test case class used to test a Source implementation. Subclass from and set
99
- the SOURCE property to run tests on that source.
98
+ Test case class used to test a FileSource implementation.
100
99
101
100
>>> from dffml.source.file import FileSourceConfig
102
101
>>> from dffml.source.json import JSONSource
@@ -110,7 +109,7 @@ class FileSourceTest(SourceTest):
110
109
async def test_update (self ):
111
110
with tempfile .TemporaryDirectory () as testdir :
112
111
with self .subTest (extension = None ):
113
- self .testfile = os .path .join (testdir , str (random .random ))
112
+ self .testfile = os .path .join (testdir , str (random .random () ))
114
113
await super ().test_update ()
115
114
for extension in ["xz" , "gz" , "bz2" , "lzma" , "zip" ]:
116
115
with self .subTest (extension = extension ):
@@ -121,7 +120,7 @@ async def test_update(self):
121
120
122
121
async def test_label (self ):
123
122
with tempfile .TemporaryDirectory () as testdir :
124
- self .testfile = os .path .join (testdir , str (random .random ))
123
+ self .testfile = os .path .join (testdir , str (random .random () ))
125
124
unlabeled = await self .setUpSource ()
126
125
labeled = await self .setUpSource ()
127
126
labeled .config = labeled .config ._replace (label = "somelabel" )
0 commit comments