def given_lines(self): return _unindent(""" # hi dad [item.AA.meta] [item.BB.attributes] no = "see" """)
def test_100_EVERYTHING(self): body_lines = tuple(_unindent(self.given_entity_body_lines())) tb = _table_block_via_body_lines(body_lines) one, = tb._body_blocks self.assertEqual(one.attribute_name_string, 'love-potion') _actual = tuple(one.to_line_stream()) self.assertSequenceEqual(_actual, body_lines)
def _comment_tester_via_big_string_using_hack(big_s): _lines = _unindent(big_s) listener = _debugging_listener() if True else _no_listener _tb = _table_block_via_body_lines(_lines) _bb = _tb.to_body_block_stream_as_table_block_() # hackishly use this as reader for array return _subject_module().comment_tester_via_body_blocks_(_bb, listener)
def CONFIRM_THIS_LOOKS_LIKE_THE_DELETED_ENTITY(self, table_block): _expected = tuple(_unindent(""" [item.B7F.attributes] thing_1 = "hi F" thing_2 = "hey F" """)) _actual = tuple(table_block.to_line_stream()) self.assertSequenceEqual(_actual, _expected)
def test_250_entities_file_rewrite_OK(self): efr = self.entity_file_rewrite() self.assertEqual(last_3_of_path(efr.path), 'entities/2/J.toml') expect = tuple(_unindent(""" [item.2J3.attributes] abc = "456" de_fg = "false" """)) self.assertSequenceEqual(efr.lines, expect)
def given_lines(self): return _unindent(""" # comment [item.A.attributes] [item.B.attributes] see-me = "do see me" [item.C.meta] [item.B.attributes] see-me = "don't see me" """)
def test_300_entities_file_lines_look_good(self): expect = tuple(_unindent(""" [item.B7E.attributes] thing_1 = "hi E" thing_2 = "hey E" [item.B7G.attributes] thing_1 = "hi G" thing_2 = "hey G" """)) self.assertSequenceEqual(self.entity_file_rewrite().lines, expect)
def test_600_new_file_content_looks_okay(self): recs = self.flush_filesystem_recordings() rec, = recs # only one file rewrite path = rec.path lines = rec.lines # -- self.assertEqual(last_three_path_parts(path), 'entities/B/9.toml') _expected = tuple(_unindent(self._expecting_these())) self.assertSequenceEqual(lines, _expected)
def given_lines(self): return _unindent(""" # hi hungry i'm dad [item.AA.attributes] xx = "yy" zz = "qq" [item.BB.attributes] # comment here OK aa = "bb" [item.CC.attributes] dd = "ee" """)
def _given_ABC_lines(): return tuple( _unindent(""" [item.AA.attributes] prop-1 = 123 prop-2 = "value aa" [item.BB.attributes] prop-1 = 234 prop-2 = "value bb" [item.CC.attributes] prop-1 = 345 prop-2 = "value cc" """))
def test_250_entities_file_rewrite_OK(self): efr = self.entity_file_rewrite() self.assertEqual(last_3_of_path(efr.path), 'entities/2/H.toml') # (below values used to be primitives but becamse strings #history-B.1) expect = tuple(_unindent(""" [item.2HG.attributes] thing_2 = "-2.718" thing_B = "false" [item.2HJ.attributes] """)) # no blank line to separate, huh? self.assertSequenceEqual(efr.lines, expect)
def given_lines(self): return _unindent(""" [item.QQ.attributes] no = "see" """)
def given_lines(self): return _unindent(""" # hi dad [item.QQ.attributes] yes = see """)
def given_lines(self): return _unindent(""" # hi dad [items.QQ] no = "see" """)
def given_lines(self): return _unindent(""" # hi hunger i'm dad. blank line next. """)