Skip to content

Commit

Permalink
fix whitespace issue in 'networkx.generators.tests.test_internet_as_g… (
Browse files Browse the repository at this point in the history
#6324)

fix whitespace issue in 'networkx.generators.tests.test_internet_as_graphs'

Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
  • Loading branch information
danieleades and daniel.eades committed Jan 4, 2023
1 parent 35cba95 commit 814b295
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions networkx/generators/tests/test_internet_as_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ def setup_class(cls):
elif cls.G.nodes[i]["type"] == "CP":
cls.CP.append(i)
else:
raise ValueError(
"Inconsistent data in the graph\
node attributes"
)
raise ValueError("Inconsistent data in the graph node attributes")
cls.set_customers(i)
cls.set_providers(i)

Expand All @@ -48,8 +45,7 @@ def set_customers(cls, i):
cls.customers[i].add(j)
elif i != customer:
raise ValueError(
"Inconsistent data in the graph\
edge attributes"
"Inconsistent data in the graph edge attributes"
)

@classmethod
Expand All @@ -66,8 +62,7 @@ def set_providers(cls, i):
cls.providers[i].add(j)
elif j != customer:
raise ValueError(
"Inconsistent data in the graph\
edge attributes"
"Inconsistent data in the graph edge attributes"
)

def test_wrong_input(self):
Expand Down Expand Up @@ -136,10 +131,7 @@ def test_degree_values(self):
elif j == cust:
prov = i
else:
raise ValueError(
"Inconsistent data in the graph edge\
attributes"
)
raise ValueError("Inconsistent data in the graph edge attributes")
if cust in self.M:
d_m += 1
if self.G.nodes[prov]["type"] == "T":
Expand All @@ -153,10 +145,7 @@ def test_degree_values(self):
if self.G.nodes[prov]["type"] == "T":
t_cp += 1
else:
raise ValueError(
"Inconsistent data in the graph edge\
attributes"
)
raise ValueError("Inconsistent data in the graph edge attributes")
elif e["type"] == "peer":
if self.G.nodes[i]["type"] == "M" and self.G.nodes[j]["type"] == "M":
p_m_m += 1
Expand All @@ -170,10 +159,7 @@ def test_degree_values(self):
):
p_cp_m += 1
else:
raise ValueError(
"Unexpected data in the graph edge\
attributes"
)
raise ValueError("Unexpected data in the graph edge attributes")

assert d_m / len(self.M) == approx((2 + (2.5 * self.n) / 10000), abs=1e-0)
assert d_cp / len(self.CP) == approx((2 + (1.5 * self.n) / 10000), abs=1e-0)
Expand Down

0 comments on commit 814b295

Please sign in to comment.