Beispiel #1
0
    def test_change_request(self):
        """Unittest for Atlas change request"""
        if self.server == "":
            raise SkipTest

        remove = AtlasChangeSource(**{
            "value": "6001",
            "requested": 1,
            "action": "remove",
            "type": "probes"
        })
        add = AtlasChangeSource(**{
            "value": "6002",
            "requested": 1,
            "action": "add",
            "type": "probes"
        })
        request = AtlasChangeRequest(
            **{
                "key": self.change_key,
                "verify": False,
                "msm_id": 1000032,
                "server": self.server,
                "sources": [add, remove]
            })
        result = namedtuple('Result', 'success response')
        (result.success, result.response) = request.create()
        print(result.response)
        self.assertTrue(result.success)
 def setUp(self):
     change_source = AtlasChangeSource(
         **{"value": "WW", "requested": 3, "action": "add", "type": "area"}
     )
     self.request = AtlasChangeRequest(**{
         "msm_id": 1, "sources": [change_source]
     })
class TestAtlasChangeRequest(TestCase):
    def setUp(self):
        change_source = AtlasChangeSource(
            **{"value": "WW", "requested": 3, "action": "add", "type": "area"}
        )
        self.request = AtlasChangeRequest(**{"msm_id": 1, "sources": [change_source]})

    def test_construct_post_data(self):
        self.request._construct_post_data()
        validate(self.request.post_data, post_data_change_schema)
class TestAtlasChangeRequest(unittest.TestCase):
    def setUp(self):
        change_source = AtlasChangeSource(
            **{"value": "3,4", "requested": 3, "action": "add"}
        )
        self.request = AtlasChangeRequest(**{
            "msm_id": 1, "sources": [change_source]
        })

    def test_construct_post_data(self):
        self.request._construct_post_data()
        validate(self.request.post_data, post_data_change_schema)
 def setUp(self):
     change_source = AtlasChangeSource(
         **{"value": "3,4", "requested": 3, "action": "add"}
     )
     self.request = AtlasChangeRequest(**{
         "msm_id": 1, "sources": [change_source]
     })
def test_change_request():
    """Unittest for Atlas change request"""
    raise SkipTest("Skip change request")
    remove = AtlasChangeSource(**{
        "value": "59", "requested": 1, "action": "remove"
    })
    add = AtlasChangeSource(**{
        "value": "28", "requested": 1, "action": "add", "type": "probes"
    })
    request = AtlasChangeRequest(
        **{
            "key": "testing",
            "server": "testing",
            "msm_id": 1019016,
            "sources": [add, remove]
        }
    )
    result = namedtuple('Result', 'success response')
    (result.success, result.response) = request.create()
    assert (result.success)
    def test_change_request(self):
        """Unittest for Atlas change request"""
        if self.server == "":
            raise SkipTest

        remove = AtlasChangeSource(**{
            "value": "6001", "requested": 1, "action": "remove", "type": "probes"
        })
        add = AtlasChangeSource(**{
            "value": "6002", "requested": 1, "action": "add", "type": "probes"
        })
        request = AtlasChangeRequest(
            **{
                "key": self.change_key,
                "msm_id": 1000032,
                "server": self.server,
                "sources": [add, remove]
            }
        )
        result = namedtuple('Result', 'success response')
        (result.success, result.response) = request.create()
        self.assertTrue(result.success)