コード例 #1
0
ファイル: commands_test.py プロジェクト: esiwgnahz/oq-engine
 def test_source_model(self):
     tempdir = tempfile.mkdtemp()
     dest = os.path.join(tempdir, 'source_model.xml')
     shutil.copy(os.path.join(self.TESTDIR, 'source_model.xml'), tempdir)
     with Print.patch() as p:
         reduce(dest, 0.5)
     self.assertIn('Extracted 9 nodes out of 15', str(p))
     shutil.rmtree(tempdir)
コード例 #2
0
ファイル: commands_test.py プロジェクト: abdolrezat/oq-engine
 def test_source_model(self):
     tempdir = tempfile.mkdtemp()
     dest = os.path.join(tempdir, 'source_model.xml')
     shutil.copy(os.path.join(self.TESTDIR, 'source_model.xml'), tempdir)
     with Print.patch() as p:
         reduce(dest, 0.5)
     self.assertIn('Extracted 9 nodes out of 15', str(p))
     shutil.rmtree(tempdir)
コード例 #3
0
ファイル: commands_test.py プロジェクト: esiwgnahz/oq-engine
 def test_sites_csv(self):
     testdir = os.path.dirname(case_5.__file__)
     tempdir = tempfile.mkdtemp()
     dest = os.path.join(tempdir, 'sites.csv')
     shutil.copy(os.path.join(testdir, 'sites.csv'), tempdir)
     with Print.patch() as p:
         reduce(dest, 0.5)
     self.assertIn('Extracted 50 lines out of 100', str(p))
     shutil.rmtree(tempdir)
コード例 #4
0
ファイル: commands_test.py プロジェクト: esiwgnahz/oq-engine
 def test_site_model(self):
     testdir = os.path.dirname(case_4.__file__)
     tempdir = tempfile.mkdtemp()
     dest = os.path.join(tempdir, 'site_model.xml')
     shutil.copy(os.path.join(testdir, 'site_model.xml'), tempdir)
     with Print.patch() as p:
         reduce(dest, 0.5)
     self.assertIn('Extracted 2 nodes out of 3', str(p))
     shutil.rmtree(tempdir)
コード例 #5
0
ファイル: commands_test.py プロジェクト: abdolrezat/oq-engine
 def test_sites_csv(self):
     testdir = os.path.dirname(case_5.__file__)
     tempdir = tempfile.mkdtemp()
     dest = os.path.join(tempdir, 'sites.csv')
     shutil.copy(os.path.join(testdir, 'sites.csv'), tempdir)
     with Print.patch() as p:
         reduce(dest, 0.5)
     self.assertIn('Extracted 50 lines out of 100', str(p))
     shutil.rmtree(tempdir)
コード例 #6
0
ファイル: commands_test.py プロジェクト: abdolrezat/oq-engine
 def test_site_model(self):
     testdir = os.path.dirname(case_4.__file__)
     tempdir = tempfile.mkdtemp()
     dest = os.path.join(tempdir, 'site_model.xml')
     shutil.copy(os.path.join(testdir, 'site_model.xml'), tempdir)
     with Print.patch() as p:
         reduce(dest, 0.5)
     self.assertIn('Extracted 2 nodes out of 3', str(p))
     shutil.rmtree(tempdir)