Пример #1
0
    def test_encode_namespace(self):
        transport = mock.Mock(spec=metrics.NullTransport)

        client = metrics.BaseClient(transport, "name")
        self.assertEqual(client.namespace, b"name")

        with self.assertRaises(UnicodeEncodeError):
            metrics.BaseClient(transport, "☃")
Пример #2
0
 def setUp(self):
     transport = mock.Mock(spec=metrics.NullTransport)
     self.client = metrics.BaseClient(transport, "namespace")