def test_default_target(self): '''Verify default local target url ''' target = OpenerTarget(self.local_file) self.assertEqual(type(target), LocalTarget) # Write to the target target.open('w').close() self.assertTrue(LocalTarget.fs.exists(self.local_file))
def test_mock_target_root(self): '''Verify mock target url ''' target = OpenerTarget('mock:///foo/bar.txt') self.assertEqual(type(target), MockTarget) # Write to the target target.open('w').close() self.assertTrue(MockTarget.fs.exists('/foo/bar.txt'))
def test_local_target(self): '''Verify basic local target url ''' local_file = "file://{}".format(self.local_file) target = OpenerTarget(local_file) self.assertEqual(type(target), LocalTarget) # Write to the target target.open('w').close() self.assertTrue(LocalTarget.fs.exists(self.local_file))