def test_gen_map(self): # Test normalized map first -- ground blocks are converged to one value self.assertEqual(normalize_map(zero_map), normalize_map(generate_block(0, 0, 0))) # Then test individual blocks self.assertEqual(zero_map, generate_block(0, 0, 0)) # Uses random number generator -- seed inside self.assertEqual(zero_map, generate_block(0, 0, 0)) self.assertNotEqual(zero_map, generate_block(1, 0, 0)) self.assertNotEqual(zero_map, generate_block(0, 1, 0)) self.assertNotEqual(zero_map, generate_block(0, 0, 1))
def write_obs_map(filepath): open(filepath).write(generate_obstacle_map( generate_block(0,0,0), len(generate_block(0,0,0))))
def write_zero_map(filepath): open(filepath).write(generate_block(0,0,0))