def test_ribx_13_manhole_start_consistent(self): """Test that manhole_start is one of the two manholes of the pipe.""" mode = Mode.INSPECTION f = os.path.join(RIBX13_DATA_DIR, "36190148 5300093.ribx") ribx, log = parse(f, mode) p0, p1 = ribx.inspection_pipes self.assertTrue(p0.manhole_start in [p0.manhole1.ref, p0.manhole2.ref]) self.assertTrue(p1.manhole_start in [p1.manhole1.ref, p1.manhole2.ref])
def test_ribx_13_manhole_start_set(self): """This ribx has two inspection headers with the same Pipe ref. For inspection of Pipes the manhole_start attribute must be set. """ mode = Mode.INSPECTION f = os.path.join(RIBX13_DATA_DIR, "36190148 5300093.ribx") ribx, log = parse(f, mode) p0, p1 = ribx.inspection_pipes # there are only 2 pipes (see file) self.assertEqual(p0.ref, p1.ref) self.assertNotEqual(p0.manhole_start, p1.manhole_start)
def main(): logging.basicConfig(level=logging.INFO) if len(sys.argv) < 2: logger.critical("Pass in a ribx filename") sys.exit(1) filename = sys.argv[1] logger.info("Reading %s (in 'inspection' mode)", filename) ribx, error_log = parsers.parse(open(filename), parsers.Mode.INSPECTION) if error_log: logger.error("Error log found:\n%s", error_log) for item_list_name in POSSIBLE_ITEM_LISTS: item_list = getattr(ribx, item_list_name) title = "%s: %s items" % (item_list_name, len(item_list)) print(title) print('=' * len(title)) print('') for item in item_list: item.print_for_debug() print('')
def test_case_3(self): mode = Mode.INSPECTION f = os.path.join(DATA_DIR, "demobestand.ribxA") ribx, log = parse(f, mode) ##self.assertFalse(log) self.assertFalse(len(log))
def test_case_2(self): mode = Mode.INSPECTION f = os.path.join(DATA_DIR, "237_0-2013-R.ribx") ribx, log = parse(f, mode) ##self.assertFalse(log) self.assertFalse(len(log))
def test_ribx_13_smoke(self): mode = Mode.INSPECTION f = os.path.join(RIBX13_DATA_DIR, "36190148 5300093.ribx") ribx, log = parse(f, mode) # self.assertFalse(log) self.assertFalse(len(log))