Ejemplo n.º 1
0
    def test_list_services(self, mock_list):
        sot = CloudCDNClient(mock.MagicMock())
        sot.list_services()
        mock_list.assert_called_with(limit=None, marker=None)

        kwargs = {"limit": 1, "marker": 2}
        sot.list_services(**kwargs)
        mock_list.assert_called_with(**kwargs)
Ejemplo n.º 2
0
 def test_delete_assets(self, mock_delete):
     sot = CloudCDNClient(mock.MagicMock())
     args = (1, 2, 3)
     sot.delete_assets(*args)
     mock_delete.assert_called_once_with(*args)
Ejemplo n.º 3
0
 def test_delete_service(self, mock_delete):
     sot = CloudCDNClient(mock.MagicMock())
     service = "service"
     sot.delete_service(service)
     mock_delete.assert_called_once_with(service)
Ejemplo n.º 4
0
 def test_patch_service(self, mock_patch):
     sot = CloudCDNClient(mock.MagicMock())
     args = (1, 2)
     sot.patch_service(*args)
     mock_patch.assert_called_once_with(*args)
Ejemplo n.º 5
0
 def test_create_service(self, mock_create):
     sot = CloudCDNClient(mock.MagicMock())
     args = (1, 2, 3, 4, 5, 6, 7)
     sot.create_service(*args)
     mock_create.assert_called_once_with(*args)
Ejemplo n.º 6
0
 def test_get_service(self, mock_get):
     sot = CloudCDNClient(mock.MagicMock())
     service = "service"
     sot.get_service(service)
     mock_get.assert_called_once_with(service)
Ejemplo n.º 7
0
 def test_get_flavor(self, mock_get):
     sot = CloudCDNClient(mock.MagicMock())
     flavor = "flavor"
     sot.get_flavor(flavor)
     mock_get.assert_called_once_with(flavor)
Ejemplo n.º 8
0
 def test_list_flavors(self, mock_list):
     sot = CloudCDNClient(mock.MagicMock())
     sot.list_flavors()
     mock_list.assert_called_once_with()
Ejemplo n.º 9
0
 def test_ping(self, mock_get):
     sot = CloudCDNClient(mock.MagicMock())
     sot.ping()
     mock_get.assert_called_with("/ping")