Beispiel #1
0
 def test_empty_points(self):
     user_input = '{"lattice": "bcc", "points": []}'
     self.assertFalse(
         miller.grade(user_input, {
             'miller': '(2,2,2)',
             'lattice': 'bcc'
         }))
Beispiel #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'
         }))
Beispiel #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': ''
         }))
Beispiel #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'
         }))
Beispiel #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'
         }))
Beispiel #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'
         }))
Beispiel #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'
         }))
Beispiel #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'
         }))
Beispiel #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': ''
         }))
Beispiel #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'
         }))
Beispiel #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'}))
Beispiel #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'}))
Beispiel #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'}))
Beispiel #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': ''}))
Beispiel #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': ''}))
Beispiel #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'}))
Beispiel #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'}))
Beispiel #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'}))
Beispiel #19
0
 def test_empty_points(self):
     user_input = '{"lattice": "bcc", "points": []}'
     self.assertFalse(miller.grade(user_input, {'miller': '(2,2,2)', 'lattice': 'bcc'}))
Beispiel #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'}))