コード例 #1
0
    def test_put_schema__time_empty_should_fail(self):
        # arrange
        SUT = {"time": ""}

        # act
        with self.assertRaises(er.MultipleInvalid):
            Index.PUT_SCHEMA(SUT)
コード例 #2
0
    def test_put_schema_with_empty_pin_code_should_pass(self):
        # arrange
        SUT = {
            "id": 1,
            "enable": True,
            "pdpContext": {
                "static": True,
                "id": 1,
                "retryTimeout": 1200,
                "primary": {
                    "apn": "internet",
                    "type": "ipv4v6"
                },
                "secondary": {
                    "type": "ipv4v6"
                }
            },
            "pinCode": u"",
            "keepalive": {
                "enable": True,
                "targetHost": "8.8.8.8",
                "intervalSec": 60,
                "reboot": {
                    "enable": False,
                    "cycles": 1
                }
            }
        }

        # act
        data = Index.PUT_SCHEMA(SUT)

        # assert
        self.assertEqual(SUT, data)
コード例 #3
0
    def test_put_schema__should_pass(self):
        # arrange
        SUT = {
            "time": "2015-03-26T16:27:48.611441Z",
            "timezone": "Asia/Taipei",
            "ntp": {
                "enable": True,
                "server": "pool.ntp.org",
                "interval": 7200
            }
        }

        # act
        data = Index.PUT_SCHEMA(SUT)

        # assert
        self.assertEqual(SUT, data)