示例#1
0
class TestBoardSerializeDeserialize(unittest.TestCase):
    board = Board('Story Map', [
        Cut('ReleaseA', [
            SwimLane('Todo', [
                Card('Too many code, to many concepts.'),
                Card('Cats is cuts with nuts.')
            ])
        ])
    ])

    def test__to_dict__from_dict(self):
        expected = self.board

        dict_ = self.board.to_dict()
        result = Board.from_dict(dict_)

        self.assertEqual(expected, result)

    def test__to_json_file__from_json_file(self):
        path = 'ng_django/examples/dsl_board/board.json'
        expected = self.board

        expected.to_json_file(path)
        result = Board.from_json_file(path)

        self.assertEqual(expected, result)

    def test__to_json__from_json(self):
        expected = self.board

        result = Board.from_json(expected.to_json())

        self.assertEqual(expected, result)
示例#2
0
    def test__to_dict__from_dict(self):
        expected = self.board

        dict_ = self.board.to_dict()
        result = Board.from_dict(dict_)

        self.assertEqual(expected, result)
示例#3
0
    def test__to_json_file__from_json_file(self):
        path = 'ng_django/examples/dsl_board/board.json'
        expected = self.board

        expected.to_json_file(path)
        result = Board.from_json_file(path)

        self.assertEqual(expected, result)
示例#4
0
    def test(self):
        # expected = Board(name='Интернет магазин', rows=[])
        expected = Board(name='TEST', rows=[])
        text = """
[board]
name = Интернет магазин
        """

        result = BoardIniParser().parse(text)

        self.assertEqual(expected, result)
示例#5
0
class TestMethodChainingCreation(unittest.TestCase):
    board = Board('Story Map', [
        Cut('ReleaseA', [
            SwimLane('Todo', [
                Card('Too many code, to many concepts.'),
                Card('Cats is cuts with nuts.')
            ])
        ])
    ])

    @unittest.skip('')
    def test(self):
        expected = self.board

        result = \
            board('Story Map', (
                cut('ReleaseA')
                    .swimlane('Todo')
                        .card('Too many code, to many concepts.')
                        .card('Cats is cuts with nuts.')
            ))

        self.assertEqual(expected, result)
示例#6
0
 def parse_section(self, line):
     section_name = re.search(r'^\s*\[(.*)\]', line).groups(0)[0]
     if section_name == 'board':
         self.board = Board(name='TEST', rows=[])
         return
     raise ValueError('Section not found')
示例#7
0
    def test__to_json__from_json(self):
        expected = self.board

        result = Board.from_json(expected.to_json())

        self.assertEqual(expected, result)
示例#8
0
def board(name, cuts):
    return Board(name, cuts)
示例#9
0
    def test_board_is_empty(self):
        board = Board('', None)

        result = board.is_empty()

        self.assertTrue(result)
示例#10
0
    def test_board_is_not_empty__with_one_cut(self):
        board = Board('', [1])

        result = board.is_empty()

        self.assertFalse(result)