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, "☃")
def setUp(self): transport = mock.Mock(spec=metrics.NullTransport) self.client = metrics.BaseClient(transport, "namespace")