Exemplo n.º 1
0
 def test_method_for_build_placement_with_equalsize(self):
     this_list2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
     n_build_list = Build_location.get_surronding_area(self, this_list2)
     assert len(n_build_list) == 2
Exemplo n.º 2
0
 def test_method_for_uneven_base2(self):
     test_list6 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                   [0, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                   [0, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                   [0, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
     n_build_list = Build_location.get_surronding_area(self, test_list6)
     assert len(n_build_list) == 1
Exemplo n.º 3
0
 def test_method_for_different_size2(self):
     this_list4 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 1, 1, 0, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
     n_build_list = Build_location.get_surronding_area(self, this_list4)
     assert len(n_build_list) == 2
Exemplo n.º 4
0
 def test_method_for_multiple_build_placement(self):
     this_list3 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 1, 1, 1, 0, 0, 1, 1, 1, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
     n_build_list = Build_location.get_surronding_area(self, this_list3)
     assert len(n_build_list) == 4
Exemplo n.º 5
0
 def test_mock_for_Build_Placement(self):
     this_list5 = [
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     ]
     n_build_list = Build_location.get_surronding_area(self, this_list5)
     assert len(n_build_list) == 7
Exemplo n.º 6
0
 def test_for_ordinary_build_placement(self):
     this_list = [[0, 0, 0, 0, 0], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0],
                  [0, 1, 1, 1, 0], [0, 0, 0, 0, 0]]
     n_build_list = Build_location.get_surronding_area(self, this_list)
     assert len(n_build_list) == 1
Exemplo n.º 7
0
 def test_getlist_coordionate(self):
     value = 2000 % 82
     index = 34
     list_value = Build_location.get_location_in_list(self, value, index)
     should_be = (2000 % 82) * 82 + 34
     assert list_value == should_be
Exemplo n.º 8
0
 def test_get_biggest_areas(self):
     list = [(40, 51, 0), (51, 40, 1), (60, 40, 2), (60, 40, 3)]
     n_build_list = Build_location.get_build_areas(self, list)
     assert len(0) == 2
     assert n_build_list == [(60, 40, 2), (60, 40, 3)]
Exemplo n.º 9
0
 def test_location_for_which_aint_valid(self):
     list = [(-1, 81, 0)]
     n_build_list = Build_location.get_good_points(self, list)
     assert len(n_build_list) == 0
     assert n_build_list == []
Exemplo n.º 10
0
 def test_good_location(self):
     list = [(41, 51, 0)]
     n_list = Build_location.get_good_points(self, list)
     assert len(n_list) == 1
     assert n_list == [(41, 51, 0)]
Exemplo n.º 11
0
 def test_odd_build_areas(self):
     this_build_area = [(3, 3, 3, 3)]
     n_build_list = Build_location.build_location(self, this_build_area)
     assert len(n_build_list) == 1
     value = n_build_list[0]
     assert value == [(2, 2, 9)]
Exemplo n.º 12
0
 def test_gettting_middle_build_area(self):
     this_build_area = [(2, 2, 2, 2)]
     n_build_list = Build_location.build_location(self, this_build_area)
     assert len(n_build_list) == 1
     value = n_build_list[0]
     assert value == (1, 1, 4)
Exemplo n.º 13
0
 def test_build_location_zeros(self):
     this_build_area = [(0, 0, 0, 0)]
     n_build_list = Build_location.build_location(self, this_build_area)
     assert len(n_build_list) == 0
Exemplo n.º 14
0
 def test_build_location_empty(self):
     this_build_area = [()]
     n_build_list = Build_location.build_location(self, this_build_area)
     assert len(n_build_list) == 0
Exemplo n.º 15
0
 def test_odd_size_location(self):
     this_list_odd = [[0, 0, 0, 0, 0], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0],
                      [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0],
                      [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [0, 0, 0, 0, 0]]
     n_build_list = Build_location.get_surronding_area(self, this_list_odd)
     assert len(n_build_list) == 1