Esempio n. 1
0
 def test_empty_points(self):
     user_input = '{"lattice": "bcc", "points": []}'
     self.assertFalse(
         miller.grade(user_input, {
             'miller': '(2,2,2)',
             'lattice': 'bcc'
         }))
Esempio n. 2
0
 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'
         }))
Esempio n. 3
0
 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': ''
         }))
Esempio n. 4
0
 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'
         }))
Esempio n. 5
0
 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'
         }))
Esempio n. 6
0
 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'
         }))
Esempio n. 7
0
 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'
         }))
Esempio n. 8
0
 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'
         }))
Esempio n. 9
0
 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': ''
         }))
Esempio n. 10
0
 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'
         }))
Esempio n. 11
0
 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'}))
Esempio n. 12
0
 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'}))
Esempio n. 13
0
 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'}))
Esempio n. 14
0
 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': ''}))
Esempio n. 15
0
 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': ''}))
Esempio n. 16
0
 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'}))
Esempio n. 17
0
 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'}))
Esempio n. 18
0
 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'}))
Esempio n. 19
0
 def test_empty_points(self):
     user_input = '{"lattice": "bcc", "points": []}'
     self.assertFalse(miller.grade(user_input, {'miller': '(2,2,2)', 'lattice': 'bcc'}))
Esempio n. 20
0
 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'}))