Ejemplo n.º 1
0
class TestIOSource(unittest.TestCase):

    def setUp(self):
        self.file = 'somepath'
        self.options = {'a': 1, 'b': 2}

        self.source = IOSource(self.file, self.options)

    def test_attributes(self):
        self.assertEqual(self.source.file, self.file)
        self.assertEqual(self.source.options, self.options)

    def test_can_read(self):
        self.assertEqual(self.source.can_read(), False)

    def test_can_write(self):
        self.assertEqual(self.source.can_write(), False)

    def test_get_reader(self):
        with self.assertRaises(NotImplementedError):
            self.source.get_reader()

    def test_get_writer(self):
        with self.assertRaises(NotImplementedError):
            self.source.get_writer()
Ejemplo n.º 2
0
    def setUp(self):
        self.file = 'somepath'
        self.options = {'a': 1, 'b': 2}

        self.source = IOSource(self.file, self.options)