Esempio n. 1
0
class ZipkinConfig(config.Config):
    host = config.StrField(default="localhost", env="ZIPKIN_HOST")
    port = config.IntField(default=9411, env="ZIPKIN_PORT")
    enabled = config.BoolField(default=False, env="ZIPKIN_ENABLED")

    def get_address(self) -> str:
        return f"http://{self.host}:{self.port}/api/v2/spans"
Esempio n. 2
0
 def test_normalize_failed(self, payload):
     field = config.IntField(default=0)
     with pytest.raises(config.InvalidField):
         field.normalize(payload)
Esempio n. 3
0
 class ConsulConfig(config.Config):
     host = config.StrField(default="localhost", env="CONSUL_HOST")
     port = config.IntField(default=8500, env="CONSUL_PORT")
Esempio n. 4
0
 def test_normalize(self, payload):
     field = config.IntField(default=0)
     normalized = field.normalize(payload)
     assert normalized == 5432