コード例 #1
0
 def test_conf(self, *args):
     conf = AutopushConfig.from_argparse(self.TestArg)
     app = EndpointApplication(conf)
     # verify that the hostname is what we said.
     assert conf.hostname == self.TestArg.hostname
     assert app.routers["gcm"].router_conf['collapsekey'] == "collapse"
     assert app.routers["apns"].router_conf['firefox']['cert'] == \
         "cert.file"
     assert app.routers["apns"].router_conf['firefox']['key'] == "key.file"
コード例 #2
0
 def test_settings(self, *args):
     settings = AutopushSettings.from_argparse(self.TestArg)
     app = EndpointApplication(settings)
     # verify that the hostname is what we said.
     eq_(settings.hostname, self.TestArg.hostname)
     eq_(app.routers["gcm"].config['collapsekey'], "collapse")
     eq_(app.routers["apns"]._config['firefox']['cert'], "cert.file")
     eq_(app.routers["apns"]._config['firefox']['key'], "key.file")
     eq_(settings.wake_timeout, 10)
コード例 #3
0
    def test_conf(self, *args):
        self.TestArg.fcm_service_cred_path = "some/file.json"
        self.TestArg.fcm_project_id = "fir_testbridge"
        conf = AutopushConfig.from_argparse(self.TestArg)
        app = EndpointApplication(conf, resource=autopush.tests.boto_resource)
        # verify that the hostname is what we said.
        assert conf.hostname == self.TestArg.hostname
        assert app.routers["gcm"].router_conf['collapsekey'] == "collapse"
        assert app.routers["apns"].router_conf['firefox']['cert'] == \
            "cert.file"
        assert app.routers["apns"].router_conf['firefox']['key'] == "key.file"
        assert app.routers["adm"].router_conf['dev']['app_id'] == \
            "amzn1.application.StringOfStuff"
        assert app.routers["adm"].router_conf['dev']['client_id'] == \
            "amzn1.application-oa2-client.ev4nM0reStuff"
        assert app.routers["adm"].router_conf['dev']['client_secret'] == \
            "deadbeef0000decafbad1111"

        conf = AutopushConfig.from_argparse(self.TestArg)
        assert conf.router_conf['fcm']['version'] == 0
        app = EndpointApplication(conf, resource=autopush.tests.boto_resource)
        assert app.routers["fcm"].router_conf["version"] == 0