コード例 #1
0
ファイル: brain.py プロジェクト: vijayaraju/everyblock-1
 def assertSerializes(self, brain):
     """
     Serializes and unserializes the given brain, asserting that a round
     trip works properly.
     """
     b = Brain(brain)
     self.assertEqual(b, Brain.from_serialized(b.serialize()))
コード例 #2
0
ファイル: brain.py プロジェクト: AndrewJHart/everyblock_code
 def assertSerializes(self, brain):
     """
     Serializes and unserializes the given brain, asserting that a round
     trip works properly.
     """
     b = Brain(brain)
     self.assertEqual(b, Brain.from_serialized(b.serialize()))
コード例 #3
0
ファイル: brain.py プロジェクト: vijayaraju/everyblock-1
 def test_format_input2(self):
     self.assertEqual(
         Brain([Hole(), 'abc', Hole()]),
         Brain.from_serialized(
             'gAJjZXZlcnlibG9jay50ZW1wbGF0ZW1ha2VyLmJyYWluCkJyYWluCnEBKYFxAihjZXZlcnlibG9j\nay50ZW1wbGF0ZW1ha2VyLmhvbGUKSG9sZQpxAymBcQR9cQViVQNhYmNxBmgDKYFxB31xCGJlfXEJ\nYi4=\n'
         ))
コード例 #4
0
ファイル: brain.py プロジェクト: vijayaraju/everyblock-1
 def test_format_input1(self):
     self.assertEqual(
         Brain([]),
         Brain.from_serialized(
             'gAJjZXZlcnlibG9jay50ZW1wbGF0ZW1ha2VyLmJyYWluCkJyYWluCnEBKYFxAn1xA2Iu\n'
         ))
コード例 #5
0
ファイル: brain.py プロジェクト: AndrewJHart/everyblock_code
 def test_format_input2(self):
     self.assertEqual(Brain([Hole(), 'abc', Hole()]), Brain.from_serialized('gAJjZXZlcnlibG9jay50ZW1wbGF0ZW1ha2VyLmJyYWluCkJyYWluCnEBKYFxAihjZXZlcnlibG9j\nay50ZW1wbGF0ZW1ha2VyLmhvbGUKSG9sZQpxAymBcQR9cQViVQNhYmNxBmgDKYFxB31xCGJlfXEJ\nYi4=\n'))
コード例 #6
0
ファイル: brain.py プロジェクト: AndrewJHart/everyblock_code
 def test_format_input1(self):
     self.assertEqual(Brain([]), Brain.from_serialized('gAJjZXZlcnlibG9jay50ZW1wbGF0ZW1ha2VyLmJyYWluCkJyYWluCnEBKYFxAn1xA2Iu\n'))
コード例 #7
0
ファイル: brain.py プロジェクト: slinkp/openblock
 def test_format_input2(self):
     # If this fails due to eg. module renaming, you can recreate
     # correct output like: Brain([Hole(), 'abc', Hole()]).serialize()
     serialized = 'gAJjZWJkYXRhLnRlbXBsYXRlbWFrZXIuYnJhaW4KQnJhaW4KcQEpgXECKGNlYmRhdGEudGVtcGxh\ndGVtYWtlci5ob2xlCkhvbGUKcQMpgXEEfXEFYlUDYWJjcQZoAymBcQd9cQhiZX1xCWIu\n'
     self.assertEqual(Brain([Hole(), 'abc', Hole()]),
                      Brain.from_serialized(serialized))
コード例 #8
0
ファイル: brain.py プロジェクト: slinkp/openblock
 def test_format_input1(self):
     # If this fails due to eg. module renaming, you can recreate
     # correct output like: Brain([]).serialize()
     serialized = 'gAJjZWJkYXRhLnRlbXBsYXRlbWFrZXIuYnJhaW4KQnJhaW4KcQEpgXECfXEDYi4=\n'
     self.assertEqual(Brain([]), Brain.from_serialized(serialized))
コード例 #9
0
ファイル: brain.py プロジェクト: DotNetWebs/openblock
 def test_format_input2(self):
     # If this fails due to eg. module renaming, you can recreate
     # correct output like: Brain([Hole(), 'abc', Hole()]).serialize()
     serialized = 'gAJjZWJkYXRhLnRlbXBsYXRlbWFrZXIuYnJhaW4KQnJhaW4KcQEpgXECKGNlYmRhdGEudGVtcGxh\ndGVtYWtlci5ob2xlCkhvbGUKcQMpgXEEfXEFYlUDYWJjcQZoAymBcQd9cQhiZX1xCWIu\n'
     self.assertEqual(Brain([Hole(), 'abc', Hole()]),
                      Brain.from_serialized(serialized))
コード例 #10
0
ファイル: brain.py プロジェクト: DotNetWebs/openblock
 def test_format_input1(self):
     # If this fails due to eg. module renaming, you can recreate
     # correct output like: Brain([]).serialize()
     serialized = 'gAJjZWJkYXRhLnRlbXBsYXRlbWFrZXIuYnJhaW4KQnJhaW4KcQEpgXECfXEDYi4=\n'
     self.assertEqual(Brain([]), Brain.from_serialized(serialized))