Bump pyupgrade target to 3.10+
... according to the versions currently supported. Change-Id: I8513dd1116f4f8afe2287908444c947728188d35 Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -31,7 +31,7 @@ repos:
|
|||||||
rev: v3.20.0
|
rev: v3.20.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py3-only]
|
args: [--py310-plus]
|
||||||
- repo: https://github.com/openstack/bashate
|
- repo: https://github.com/openstack/bashate
|
||||||
rev: 2.1.1
|
rev: 2.1.1
|
||||||
hooks:
|
hooks:
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class ConfigException(Exception):
|
|||||||
self.cfg = cfg
|
self.cfg = cfg
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '{} {}: {}'.format(self.cfg_type, self.cfg, self.msg)
|
return f'{self.cfg_type} {self.cfg}: {self.msg}'
|
||||||
|
|
||||||
|
|
||||||
class SourceException(Exception):
|
class SourceException(Exception):
|
||||||
@@ -38,7 +38,7 @@ class SourceException(Exception):
|
|||||||
self.cfg = cfg
|
self.cfg = cfg
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return 'Source definition invalid: {} ({})'.format(self.msg, self.cfg)
|
return f'Source definition invalid: {self.msg} ({self.cfg})'
|
||||||
|
|
||||||
|
|
||||||
class ConfigManagerBase:
|
class ConfigManagerBase:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PerDeviceDiskPollster(pollsters.GenericComputePollster):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_resource_id(instance, stats):
|
def get_resource_id(instance, stats):
|
||||||
return "{}-{}".format(instance.id, stats.device)
|
return f"{instance.id}-{stats.device}"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_additional_metadata(instance, stats):
|
def get_additional_metadata(instance, stats):
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class NetworkPollster(pollsters.GenericComputePollster):
|
|||||||
return stats.fref
|
return stats.fref
|
||||||
else:
|
else:
|
||||||
instance_name = util.instance_name(instance)
|
instance_name = util.instance_name(instance)
|
||||||
return "{}-{}-{}".format(instance_name, instance.id, stats.name)
|
return f"{instance_name}-{instance.id}-{stats.name}"
|
||||||
|
|
||||||
|
|
||||||
class IncomingBytesPollster(NetworkPollster):
|
class IncomingBytesPollster(NetworkPollster):
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class RGWAdminClient:
|
|||||||
self.implicit_tenants = implicit_tenants
|
self.implicit_tenants = implicit_tenants
|
||||||
|
|
||||||
def _make_request(self, path, req_params):
|
def _make_request(self, path, req_params):
|
||||||
uri = "{}/{}".format(self.endpoint, path)
|
uri = f"{self.endpoint}/{path}"
|
||||||
r = requests.get(uri, params=req_params,
|
r = requests.get(uri, params=req_params,
|
||||||
auth=S3Auth(self.access_key, self.secret,
|
auth=S3Auth(self.access_key, self.secret,
|
||||||
self.hostname)
|
self.hostname)
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class PipelineSource(agent.Source):
|
|||||||
for sink in self.sinks:
|
for sink in self.sinks:
|
||||||
if sink not in sinks:
|
if sink not in sinks:
|
||||||
raise PipelineException(
|
raise PipelineException(
|
||||||
"Dangling sink {} from source {}".format(sink, self),
|
f"Dangling sink {sink} from source {self}",
|
||||||
self.cfg)
|
self.cfg)
|
||||||
|
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ class Pipeline(metaclass=abc.ABCMeta):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return (self.source.name if self.source.name == self.sink.name
|
return (self.source.name if self.source.name == self.sink.name
|
||||||
else '{}:{}'.format(self.source.name, self.sink.name))
|
else f'{self.source.name}:{self.sink.name}')
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
self.sink.flush()
|
self.sink.flush()
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class Resources:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def key(source_name, pollster):
|
def key(source_name, pollster):
|
||||||
return '{}-{}'.format(source_name, pollster.name)
|
return f'{source_name}-{pollster.name}'
|
||||||
|
|
||||||
|
|
||||||
def iter_random(iterable):
|
def iter_random(iterable):
|
||||||
@@ -592,7 +592,7 @@ class AgentManager(cotyledon.Service):
|
|||||||
# Compose coordination group prefix.
|
# Compose coordination group prefix.
|
||||||
# We'll use namespaces as the basement for this partitioning.
|
# We'll use namespaces as the basement for this partitioning.
|
||||||
namespace_prefix = '-'.join(sorted(namespaces))
|
namespace_prefix = '-'.join(sorted(namespaces))
|
||||||
self.group_prefix = ('{}-{}'.format(namespace_prefix, group_prefix)
|
self.group_prefix = (f'{namespace_prefix}-{group_prefix}'
|
||||||
if group_prefix else namespace_prefix)
|
if group_prefix else namespace_prefix)
|
||||||
|
|
||||||
if self.conf.polling.enable_notifications:
|
if self.conf.polling.enable_notifications:
|
||||||
@@ -747,12 +747,12 @@ class AgentManager(cotyledon.Service):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _extensions(self, category, agent_ns=None, *args, **kwargs):
|
def _extensions(self, category, agent_ns=None, *args, **kwargs):
|
||||||
namespace = ('ceilometer.{}.{}'.format(category, agent_ns) if agent_ns
|
namespace = (f'ceilometer.{category}.{agent_ns}' if agent_ns
|
||||||
else 'ceilometer.%s' % category)
|
else 'ceilometer.%s' % category)
|
||||||
return self._get_ext_mgr(namespace, *args, **kwargs)
|
return self._get_ext_mgr(namespace, *args, **kwargs)
|
||||||
|
|
||||||
def _extensions_from_builder(self, category, agent_ns=None):
|
def _extensions_from_builder(self, category, agent_ns=None):
|
||||||
ns = ('ceilometer.builder.{}.{}'.format(category, agent_ns) if agent_ns
|
ns = (f'ceilometer.builder.{category}.{agent_ns}' if agent_ns
|
||||||
else 'ceilometer.builder.%s' % category)
|
else 'ceilometer.builder.%s' % category)
|
||||||
mgr = self._get_ext_mgr(ns, self.conf)
|
mgr = self._get_ext_mgr(ns, self.conf)
|
||||||
|
|
||||||
@@ -843,7 +843,7 @@ class AgentManager(cotyledon.Service):
|
|||||||
return polling_tasks
|
return polling_tasks
|
||||||
|
|
||||||
def construct_group_id(self, discovery_group_id):
|
def construct_group_id(self, discovery_group_id):
|
||||||
return '{}-{}'.format(self.group_prefix, discovery_group_id)
|
return f'{self.group_prefix}-{discovery_group_id}'
|
||||||
|
|
||||||
def start_polling_tasks(self):
|
def start_polling_tasks(self):
|
||||||
data = self.setup_polling_tasks()
|
data = self.setup_polling_tasks()
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class PrometheusPublisher(http.HttpPublisher):
|
|||||||
curated_sname = s.name.replace(".", "_")
|
curated_sname = s.name.replace(".", "_")
|
||||||
|
|
||||||
if metric_type and curated_sname not in doc_done:
|
if metric_type and curated_sname not in doc_done:
|
||||||
data += "# TYPE {} {}\n".format(curated_sname, metric_type)
|
data += f"# TYPE {curated_sname} {metric_type}\n"
|
||||||
doc_done.add(curated_sname)
|
doc_done.add(curated_sname)
|
||||||
|
|
||||||
# NOTE(sileht): prometheus pushgateway doesn't allow to push
|
# NOTE(sileht): prometheus pushgateway doesn't allow to push
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ def recursive_keypairs(d, separator=':'):
|
|||||||
for name, value in sorted(d.items()):
|
for name, value in sorted(d.items()):
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
for subname, subvalue in recursive_keypairs(value, separator):
|
for subname, subvalue in recursive_keypairs(value, separator):
|
||||||
yield ('{}{}{}'.format(name, separator, subname), subvalue)
|
yield (f'{name}{separator}{subname}', subvalue)
|
||||||
elif isinstance(value, (tuple, list)):
|
elif isinstance(value, (tuple, list)):
|
||||||
yield name, decode_unicode(value)
|
yield name, decode_unicode(value)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class TestBaseDiskIO(base.TestPollsterBase):
|
|||||||
for m in match:
|
for m in match:
|
||||||
match_dict[m.resource_id] = m
|
match_dict[m.resource_id] = m
|
||||||
for instance in self.instance:
|
for instance in self.instance:
|
||||||
key = "{}-{}".format(instance.id, expected_device)
|
key = f"{instance.id}-{expected_device}"
|
||||||
self.assertEqual(expected_volume,
|
self.assertEqual(expected_volume,
|
||||||
match_dict[key].volume)
|
match_dict[key].volume)
|
||||||
self.assertEqual(self.TYPE, match_dict[key].type)
|
self.assertEqual(self.TYPE, match_dict[key].type)
|
||||||
|
|||||||
@@ -142,123 +142,123 @@ class TestNetPollster(base.TestPollsterBase):
|
|||||||
_verify_vnic_metering(ip, volume, rid)
|
_verify_vnic_metering(ip, volume, rid)
|
||||||
|
|
||||||
def test_incoming_bytes(self):
|
def test_incoming_bytes(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.IncomingBytesPollster,
|
net.IncomingBytesPollster,
|
||||||
[('10.0.0.2', 1, self.vnic0.fref),
|
[('10.0.0.2', 1, self.vnic0.fref),
|
||||||
('192.168.0.3', 5, self.vnic1.fref),
|
('192.168.0.3', 5, self.vnic1.fref),
|
||||||
('192.168.0.4', 9,
|
('192.168.0.4', 9,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.incoming.bytes',
|
'network.incoming.bytes',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_outgoing_bytes(self):
|
def test_outgoing_bytes(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.OutgoingBytesPollster,
|
net.OutgoingBytesPollster,
|
||||||
[('10.0.0.2', 3, self.vnic0.fref),
|
[('10.0.0.2', 3, self.vnic0.fref),
|
||||||
('192.168.0.3', 7, self.vnic1.fref),
|
('192.168.0.3', 7, self.vnic1.fref),
|
||||||
('192.168.0.4', 11,
|
('192.168.0.4', 11,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.outgoing.bytes',
|
'network.outgoing.bytes',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_incoming_bytes_delta(self):
|
def test_incoming_bytes_delta(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.IncomingBytesDeltaPollster,
|
net.IncomingBytesDeltaPollster,
|
||||||
[('10.0.0.2', 42, self.vnic0.fref),
|
[('10.0.0.2', 42, self.vnic0.fref),
|
||||||
('192.168.0.3', 44, self.vnic1.fref),
|
('192.168.0.3', 44, self.vnic1.fref),
|
||||||
('192.168.0.4', 46,
|
('192.168.0.4', 46,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.incoming.bytes.delta',
|
'network.incoming.bytes.delta',
|
||||||
'delta',
|
'delta',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_outgoing_bytes_delta(self):
|
def test_outgoing_bytes_delta(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.OutgoingBytesDeltaPollster,
|
net.OutgoingBytesDeltaPollster,
|
||||||
[('10.0.0.2', 43, self.vnic0.fref),
|
[('10.0.0.2', 43, self.vnic0.fref),
|
||||||
('192.168.0.3', 45, self.vnic1.fref),
|
('192.168.0.3', 45, self.vnic1.fref),
|
||||||
('192.168.0.4', 47,
|
('192.168.0.4', 47,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.outgoing.bytes.delta',
|
'network.outgoing.bytes.delta',
|
||||||
'delta',
|
'delta',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_incoming_packets(self):
|
def test_incoming_packets(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.IncomingPacketsPollster,
|
net.IncomingPacketsPollster,
|
||||||
[('10.0.0.2', 2, self.vnic0.fref),
|
[('10.0.0.2', 2, self.vnic0.fref),
|
||||||
('192.168.0.3', 6, self.vnic1.fref),
|
('192.168.0.3', 6, self.vnic1.fref),
|
||||||
('192.168.0.4', 10,
|
('192.168.0.4', 10,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.incoming.packets',
|
'network.incoming.packets',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_outgoing_packets(self):
|
def test_outgoing_packets(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.OutgoingPacketsPollster,
|
net.OutgoingPacketsPollster,
|
||||||
[('10.0.0.2', 4, self.vnic0.fref),
|
[('10.0.0.2', 4, self.vnic0.fref),
|
||||||
('192.168.0.3', 8, self.vnic1.fref),
|
('192.168.0.3', 8, self.vnic1.fref),
|
||||||
('192.168.0.4', 12,
|
('192.168.0.4', 12,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.outgoing.packets',
|
'network.outgoing.packets',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_incoming_drops(self):
|
def test_incoming_drops(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.IncomingDropPollster,
|
net.IncomingDropPollster,
|
||||||
[('10.0.0.2', 20, self.vnic0.fref),
|
[('10.0.0.2', 20, self.vnic0.fref),
|
||||||
('192.168.0.3', 24, self.vnic1.fref),
|
('192.168.0.3', 24, self.vnic1.fref),
|
||||||
('192.168.0.4', 28,
|
('192.168.0.4', 28,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.incoming.packets.drop',
|
'network.incoming.packets.drop',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_outgoing_drops(self):
|
def test_outgoing_drops(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.OutgoingDropPollster,
|
net.OutgoingDropPollster,
|
||||||
[('10.0.0.2', 22, self.vnic0.fref),
|
[('10.0.0.2', 22, self.vnic0.fref),
|
||||||
('192.168.0.3', 26, self.vnic1.fref),
|
('192.168.0.3', 26, self.vnic1.fref),
|
||||||
('192.168.0.4', 30,
|
('192.168.0.4', 30,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.outgoing.packets.drop',
|
'network.outgoing.packets.drop',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_incoming_errors(self):
|
def test_incoming_errors(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.IncomingErrorsPollster,
|
net.IncomingErrorsPollster,
|
||||||
[('10.0.0.2', 21, self.vnic0.fref),
|
[('10.0.0.2', 21, self.vnic0.fref),
|
||||||
('192.168.0.3', 25, self.vnic1.fref),
|
('192.168.0.3', 25, self.vnic1.fref),
|
||||||
('192.168.0.4', 29,
|
('192.168.0.4', 29,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.incoming.packets.error',
|
'network.incoming.packets.error',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_outgoing_errors(self):
|
def test_outgoing_errors(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.OutgoingErrorsPollster,
|
net.OutgoingErrorsPollster,
|
||||||
[('10.0.0.2', 23, self.vnic0.fref),
|
[('10.0.0.2', 23, self.vnic0.fref),
|
||||||
('192.168.0.3', 27, self.vnic1.fref),
|
('192.168.0.3', 27, self.vnic1.fref),
|
||||||
('192.168.0.4', 31,
|
('192.168.0.4', 31,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.outgoing.packets.error',
|
'network.outgoing.packets.error',
|
||||||
)
|
)
|
||||||
@@ -341,25 +341,25 @@ class TestNetRatesPollster(base.TestPollsterBase):
|
|||||||
_verify_vnic_metering(ip, volume, rid)
|
_verify_vnic_metering(ip, volume, rid)
|
||||||
|
|
||||||
def test_incoming_bytes_rate(self):
|
def test_incoming_bytes_rate(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.IncomingBytesRatePollster,
|
net.IncomingBytesRatePollster,
|
||||||
[('10.0.0.2', 1, self.vnic0.fref),
|
[('10.0.0.2', 1, self.vnic0.fref),
|
||||||
('192.168.0.3', 3, self.vnic1.fref),
|
('192.168.0.3', 3, self.vnic1.fref),
|
||||||
('192.168.0.4', 5,
|
('192.168.0.4', 5,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.incoming.bytes.rate',
|
'network.incoming.bytes.rate',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_outgoing_bytes_rate(self):
|
def test_outgoing_bytes_rate(self):
|
||||||
instance_name_id = "{}-{}".format(self.instance.name, self.instance.id)
|
instance_name_id = f"{self.instance.name}-{self.instance.id}"
|
||||||
self._check_get_samples(
|
self._check_get_samples(
|
||||||
net.OutgoingBytesRatePollster,
|
net.OutgoingBytesRatePollster,
|
||||||
[('10.0.0.2', 2, self.vnic0.fref),
|
[('10.0.0.2', 2, self.vnic0.fref),
|
||||||
('192.168.0.3', 4, self.vnic1.fref),
|
('192.168.0.3', 4, self.vnic1.fref),
|
||||||
('192.168.0.4', 6,
|
('192.168.0.4', 6,
|
||||||
"{}-{}".format(instance_name_id, self.vnic2.name)),
|
f"{instance_name_id}-{self.vnic2.name}"),
|
||||||
],
|
],
|
||||||
'network.outgoing.bytes.rate',
|
'network.outgoing.bytes.rate',
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class ConverterBase(base.BaseTestCase):
|
|||||||
traits = [trait for trait in event.traits if trait.name == name]
|
traits = [trait for trait in event.traits if trait.name == name]
|
||||||
self.assertGreater(
|
self.assertGreater(
|
||||||
len(traits), 0,
|
len(traits), 0,
|
||||||
"Trait {} not found in event {}".format(name, event))
|
f"Trait {name} not found in event {event}")
|
||||||
trait = traits[0]
|
trait = traits[0]
|
||||||
if value is not None:
|
if value is not None:
|
||||||
self.assertEqual(value, trait.value)
|
self.assertEqual(value, trait.value)
|
||||||
@@ -71,7 +71,7 @@ class ConverterBase(base.BaseTestCase):
|
|||||||
traits = [trait for trait in event.traits if trait.name == name]
|
traits = [trait for trait in event.traits if trait.name == name]
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
len(traits), 0,
|
len(traits), 0,
|
||||||
"Extra Trait {} found in event {}".format(name, event))
|
f"Extra Trait {name} found in event {event}")
|
||||||
|
|
||||||
def assertHasDefaultTraits(self, event):
|
def assertHasDefaultTraits(self, event):
|
||||||
text = models.Trait.TEXT_TYPE
|
text = models.Trait.TEXT_TYPE
|
||||||
@@ -87,7 +87,7 @@ class ConverterBase(base.BaseTestCase):
|
|||||||
|
|
||||||
def assertPathsEqual(self, path1, path2):
|
def assertPathsEqual(self, path1, path2):
|
||||||
self.assertTrue(self._cmp_tree(path1, path2),
|
self.assertTrue(self._cmp_tree(path1, path2),
|
||||||
'JSONPaths not equivalent {} {}'.format(path1, path2))
|
f'JSONPaths not equivalent {path1} {path2}')
|
||||||
|
|
||||||
|
|
||||||
class TestTraitDefinition(ConverterBase):
|
class TestTraitDefinition(ConverterBase):
|
||||||
|
|||||||
Reference in New Issue
Block a user