예제 #1
0
파일: test_charm.py 프로젝트: bac/amulet
 def test_fetch_testcharm(self):
     c = CharmCache('mytestcharm')
     with patch.object(c, 'get_charm') as get_charm:
         charm = c.fetch('myservice', 'mytestcharm')
         self.assertEqual(charm, get_charm.return_value)
         get_charm.assert_called_once_with(os.getcwd(), branch=None,
                                           series='precise')
예제 #2
0
파일: test_charm.py 프로젝트: dannf/amulet
    def test_fetch_service(self):
        c = CharmCache("mytestcharm")
        with patch.object(c, "get_charm") as get_charm:
            charm = c.fetch("myservice")
            self.assertEqual(charm, get_charm.return_value)
            get_charm.assert_called_once_with("myservice", branch=None, series="precise")

        get_charm.reset_mock()
        charm2 = c["myservice"]
        self.assertEqual(charm, charm2)
        self.assertFalse(get_charm.called)
예제 #3
0
파일: test_charm.py 프로젝트: bac/amulet
    def test_fetch_service(self):
        c = CharmCache('mytestcharm')
        with patch.object(c, 'get_charm') as get_charm:
            charm = c.fetch('myservice')
            self.assertEqual(charm, get_charm.return_value)
            get_charm.assert_called_once_with('myservice', branch=None,
                                              series='precise')

        get_charm.reset_mock()
        charm2 = c['myservice']
        self.assertEqual(charm, charm2)
        self.assertFalse(get_charm.called)
예제 #4
0
파일: test_charm.py 프로젝트: dannf/amulet
 def test_fetch_testcharm(self):
     c = CharmCache("mytestcharm")
     with patch.object(c, "get_charm") as get_charm:
         charm = c.fetch("myservice", "mytestcharm")
         self.assertEqual(charm, get_charm.return_value)
         get_charm.assert_called_once_with(os.getcwd(), branch=None, series="precise")