Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
util: testing: FileSourceTest fix random call
Browse files Browse the repository at this point in the history
  • Loading branch information
sudharsana-kjl authored and pdxjohnny committed Jun 14, 2019
1 parent e355e86 commit 5b3a970
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions dffml/util/testing/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

class SourceTest(abc.ABC):
"""
Test case class used to test a Source implementation. Subclass from and set
the SOURCE property to run tests on that source.
Test case class used to test a Source implementation. Subclass from and
implement the setUpSource method.
>>> from dffml.source.file import FileSourceConfig
>>> from dffml.source.json import JSONSource
Expand Down Expand Up @@ -95,8 +95,7 @@ async def test_update(self):

class FileSourceTest(SourceTest):
"""
Test case class used to test a Source implementation. Subclass from and set
the SOURCE property to run tests on that source.
Test case class used to test a FileSource implementation.
>>> from dffml.source.file import FileSourceConfig
>>> from dffml.source.json import JSONSource
Expand All @@ -110,7 +109,7 @@ class FileSourceTest(SourceTest):
async def test_update(self):
with tempfile.TemporaryDirectory() as testdir:
with self.subTest(extension=None):
self.testfile = os.path.join(testdir, str(random.random))
self.testfile = os.path.join(testdir, str(random.random()))
await super().test_update()
for extension in ["xz", "gz", "bz2", "lzma", "zip"]:
with self.subTest(extension=extension):
Expand All @@ -121,7 +120,7 @@ async def test_update(self):

async def test_label(self):
with tempfile.TemporaryDirectory() as testdir:
self.testfile = os.path.join(testdir, str(random.random))
self.testfile = os.path.join(testdir, str(random.random()))
unlabeled = await self.setUpSource()
labeled = await self.setUpSource()
labeled.config = labeled.config._replace(label="somelabel")
Expand Down

0 comments on commit 5b3a970

Please sign in to comment.