| Total Complexity | 5 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 7 | class DataURIConverterTestCase(unittest.TestCase): |
||
| 8 | def test_local_image(self): |
||
| 9 | location = data_dir('bokeh-logo.png') |
||
| 10 | output = DataURIConverter(location)() |
||
| 11 | self.assertEqual(output[0:5], "iVBOR") |
||
| 12 | |||
| 13 | def test_file_not_found(self): |
||
| 14 | location = data_dir('no-exists.png') |
||
| 15 | with self.assertRaises(IOError): |
||
| 16 | DataURIConverter(location)() |
||
| 17 | |||
| 18 | def test_is_python_3(self): |
||
| 19 | output = DataURIConverter('') |
||
| 20 | self.assertIsInstance(output.is_py3(), bool) |
||
| 21 | |||
| 22 | def test_is_url(self): |
||
| 23 | location = 'http://docs.continuum.io/_static/img/continuum_analytics_logo.png' |
||
| 24 | self.assertTrue(DataURIConverter(location).is_url()) |
||
| 25 | |||
| 26 | location = data_dir('bokeh-logo.png') |
||
| 27 | self.assertNotEqual(DataURIConverter(location).is_url(), True) |
||
| 28 |