def test_empty_points(self): user_input = '{"lattice": "bcc", "points": []}' self.assertFalse( miller.grade(user_input, { 'miller': '(2,2,2)', 'lattice': 'bcc' }))
def test_wrong_lattice(self): user_input = '{"lattice": "bcc", "points": [["0.00", "0.00", "0.00"], ["1.00", "0.00", "0.00"], ["1.00", "1.00", "1.00"]]}' self.assertFalse( miller.grade(user_input, { 'miller': '(3,3,3)', 'lattice': 'fcc' }))
def test_26(self): user_input = u'{"lattice":"","points":[["0.00","0.01","0.00"],["1.00","0.00","0.00"],["0.00","0.00","1.00"]]}' self.assertTrue( miller.grade(user_input, { 'miller': '(0,-1,0)', 'lattice': '' }))
def test_19(self): user_input = '{"lattice": "bcc", "points": [["0.00", "0.00", "0.00"], ["1.00", "1.00", "0.00"], ["0.00", "0.00", "1.00"]]}' self.assertTrue( miller.grade(user_input, { 'miller': '(-1,1,0)', 'lattice': 'bcc' }))
def test_24(self): user_input = '{"lattice": "bcc", "points": [["0.66", "0.00", "0.00"], ["0.00", "0.66", "0.00"], ["0.00", "0.00", "0.66"]]}' self.assertTrue( miller.grade(user_input, { 'miller': '(3,3,3)', 'lattice': 'bcc' }))
def test_6(self): user_input = '{"lattice": "bcc", "points": [["0.00", "0.25", "0.00"], ["0.25", "0.00", "0.00"], ["0.00", "0.00", "0.25"]]}' self.assertTrue( miller.grade(user_input, { 'miller': '(4,4,4)', 'lattice': 'bcc' }))
def test_7(self): # goes throug origin user_input = '{"lattice": "bcc", "points": [["0.00", "1.00", "0.00"], ["1.00", "0.00", "0.00"], ["0.50", "1.00", "0.00"]]}' self.assertTrue( miller.grade(user_input, { 'miller': '(0,0,-1)', 'lattice': 'bcc' }))
def test_only_two_points(self): user_input = '{"lattice": "bcc", "points": [["0.50", "0.00", "0.00"], ["0.00", "0.50", "0.00"]]}' self.assertFalse( miller.grade(user_input, { 'miller': '(2,2,2)', 'lattice': 'bcc' }))
def test_28(self): """ rounding to 0.30""" user_input = u'{"lattice":"","points":[["0.30","0.00","0.00"],["0.00","0.30","0.00"],["0.00","0.00","0.30"]]}' self.assertTrue( miller.grade(user_input, { 'miller': '(10,10,10)', 'lattice': '' }))
def test_5(self): """ return true only in case points coordinates are exact. But if they transform to closest 0.05 value it is not true""" user_input = '{"lattice": "bcc", "points": [["0.33", "1.00", "0.00"], ["0.00", "0.33", "0.00"], ["0.00", "1.00", "0.33"]]}' self.assertFalse( miller.grade(user_input, { 'miller': '(-6,3,-6)', 'lattice': 'bcc' }))
def test_6(self): user_input = '{"lattice": "bcc", "points": [["0.00", "0.25", "0.00"], ["0.25", "0.00", "0.00"], ["0.00", "0.00", "0.25"]]}' self.assertTrue(miller.grade(user_input, {'miller': '(4,4,4)', 'lattice': 'bcc'}))
def test_only_two_points(self): user_input = '{"lattice": "bcc", "points": [["0.50", "0.00", "0.00"], ["0.00", "0.50", "0.00"]]}' self.assertFalse(miller.grade(user_input, {'miller': '(2,2,2)', 'lattice': 'bcc'}))
def test_wrong_lattice(self): user_input = '{"lattice": "bcc", "points": [["0.00", "0.00", "0.00"], ["1.00", "0.00", "0.00"], ["1.00", "1.00", "1.00"]]}' self.assertFalse(miller.grade(user_input, {'miller': '(3,3,3)', 'lattice': 'fcc'}))
def test_28(self): """ rounding to 0.30""" user_input = u'{"lattice":"","points":[["0.30","0.00","0.00"],["0.00","0.30","0.00"],["0.00","0.00","0.30"]]}' self.assertTrue(miller.grade(user_input, {'miller': '(10,10,10)', 'lattice': ''}))
def test_26(self): user_input = u'{"lattice":"","points":[["0.00","0.01","0.00"],["1.00","0.00","0.00"],["0.00","0.00","1.00"]]}' self.assertTrue(miller.grade(user_input, {'miller': '(0,-1,0)', 'lattice': ''}))
def test_24(self): user_input = '{"lattice": "bcc", "points": [["0.66", "0.00", "0.00"], ["0.00", "0.66", "0.00"], ["0.00", "0.00", "0.66"]]}' self.assertTrue(miller.grade(user_input, {'miller': '(3,3,3)', 'lattice': 'bcc'}))
def test_19(self): user_input = '{"lattice": "bcc", "points": [["0.00", "0.00", "0.00"], ["1.00", "1.00", "0.00"], ["0.00", "0.00", "1.00"]]}' self.assertTrue(miller.grade(user_input, {'miller': '(-1,1,0)', 'lattice': 'bcc'}))
def test_7(self): # goes throug origin user_input = '{"lattice": "bcc", "points": [["0.00", "1.00", "0.00"], ["1.00", "0.00", "0.00"], ["0.50", "1.00", "0.00"]]}' self.assertTrue(miller.grade(user_input, {'miller': '(0,0,-1)', 'lattice': 'bcc'}))
def test_empty_points(self): user_input = '{"lattice": "bcc", "points": []}' self.assertFalse(miller.grade(user_input, {'miller': '(2,2,2)', 'lattice': 'bcc'}))
def test_5(self): """ return true only in case points coordinates are exact. But if they transform to closest 0.05 value it is not true""" user_input = '{"lattice": "bcc", "points": [["0.33", "1.00", "0.00"], ["0.00", "0.33", "0.00"], ["0.00", "1.00", "0.33"]]}' self.assertFalse(miller.grade(user_input, {'miller': '(-6,3,-6)', 'lattice': 'bcc'}))