Beispiel #1
0
 def test_0_value_for_k_raises_ValueError_in_is_k_forcing(self):
     with pytest.raises(ValueError, message="Excepted non-positive value for k to throw ValueError."):
         G = gp.star_graph(2)
         gp.is_k_forcing_vertex(G, 1, [1], 0)
Beispiel #2
0
 def test_non_integral_value_for_k_raises_TypeError_in_is_k_forcing(self):
     with pytest.raises(TypeError, message="Excepted non-integral value for k to throw TypeError."):
         G = gp.star_graph(2)
         gp.is_k_forcing_vertex(G, 1, [1], 1.5)
Beispiel #3
0
 def test_center_of_S3_is_3_forcing_vertex(self):
     G = gp.star_graph(3)
     assert(gp.is_k_forcing_vertex(G, 0, [0], 3) == True)
Beispiel #4
0
 def test_center_of_S3_is_not_2_forcing_vertex(self):
     G = gp.star_graph(3)
     assert(gp.is_k_forcing_vertex(G, 0, [0], 2) == False)
Beispiel #5
0
 def test_integral_float_for_k_works(self):
     G = gp.star_graph(2)
     assert(gp.is_k_forcing_vertex(G, 1, [1], 1.0) == True)