Exemplo n.º 1
0
 def test_grid_xml_file_path(self):
     """Test eventFilePath works(using cached data)."""
     shake_id = '20120726022003'
     expected_path = os.path.join(shakemap_extract_dir(),
                                  shake_id,
                                  'grid.xml')
     shake_event = ShakeEvent(shake_id)
     grid_path = shake_event.grid_file_path()
     self.assertEquals(expected_path, grid_path)
Exemplo n.º 2
0
    def test_extract_shake_map(self):
        """Test that we can extract the shakemap inp and out files"""
        shake_event = '20120726022003'
        shake_data = ShakeData(shake_event)
        grid_xml = shake_data.extract(force_flag=True)

        extract_dir = shakemap_extract_dir()

        expected_grid_xml = (os.path.join(extract_dir,
                                          '20120726022003/grid.xml'))
        message = 'Expected: %s\nGot: %s\n' % (expected_grid_xml, grid_xml)
        assert expected_grid_xml in expected_grid_xml, message
        assert os.path.exists(grid_xml)
Exemplo n.º 3
0
    def test_extract_shake_map(self):
        """Test that we can extract the shakemap inp and out files."""
        shake_event = '20120726022003'
        shake_data = ShakeData(shake_event)
        grid_xml = shake_data.extract(force_flag=True)

        extract_dir = shakemap_extract_dir()

        expected_grid_xml = (os.path.join(extract_dir,
                                          '20120726022003/grid.xml'))
        message = 'Expected: %s\nGot: %s\n' % (expected_grid_xml, grid_xml)
        assert expected_grid_xml in expected_grid_xml, message
        assert os.path.exists(grid_xml)
Exemplo n.º 4
0
 def test_shakemap_extract_dir(self):
     """Test we can get the shakemap extracted data dir."""
     data_dir = shakemap_extract_dir()
     expected_dir = '/tmp/inasafe/realtime/shakemaps-extracted'
     assert os.path.exists(expected_dir)
     self.assertEqual(data_dir, expected_dir)
Exemplo n.º 5
0
 def test_shakemap_extract_dir(self):
     """Test we can get the shakemap extracted data dir."""
     data_dir = shakemap_extract_dir()
     expected_dir = '/tmp/inasafe/realtime/shakemaps-extracted'
     assert os.path.exists(expected_dir)
     self.assertEqual(data_dir, expected_dir)