예제 #1
0
 def test_pprint_with_label(self):
     matrix = np.array([[1, 0], [0, 1]])
     so = SymmetryOperation(matrix, label='L')
     with patch('sys.stdout', new=io.StringIO()) as mock_stdout:
         so.pprint()
         self.assertEqual(mock_stdout.getvalue(), 'L : 1 2\n')
예제 #2
0
 def test_pprint_with_label( self ):
     matrix = np.array( [ [ 1, 0 ], [ 0, 1 ] ] )
     so = SymmetryOperation( matrix, label='L' )
     with patch( 'sys.stdout', new=io.StringIO() ) as mock_stdout:
         so.pprint()
         self.assertEqual( mock_stdout.getvalue(), 'L : 1 2\n' ) 
예제 #3
0
 def test_pprint(self):
     matrix = np.matrix([[1, 0], [0, 1]])
     so = SymmetryOperation(matrix)
     with patch('sys.stdout', new=io.StringIO()) as mock_stdout:
         so.pprint()
         self.assertEqual(mock_stdout.getvalue(), '--- : 1 2\n')