Exemplo n.º 1
0
    def test_setting_invalid_path(self):
        builder = cb.FileBasedClientBuilder("nowhere")

        with self.assertRaises(IOError):
            builder.build()

        self.assertFalse(builder.file_exists)
Exemplo n.º 2
0
 def test_abstract_class_does_not_parse_config(self):
     with self.assertRaises(NotImplementedError):
         cb.FileBasedClientBuilder().parse_config()
Exemplo n.º 3
0
    def test_setting_user_path(self):
        builder = cb.FileBasedClientBuilder("~/")

        self.assertEqual(os.path.expanduser("~/"), builder.path)
Exemplo n.º 4
0
    def test_setting_valid_path(self):
        builder = cb.FileBasedClientBuilder(__file__)

        self.assertTrue(builder.file_exists)
        self.assertEqual(__file__, builder.path)