Skip to content
Snippets Groups Projects
Commit 6289b75c authored by Edward Fauchon-Jones's avatar Edward Fauchon-Jones
Browse files

Add remaining format 1 unit tests

parent 6b630cd8
No related branches found
No related tags found
No related merge requests found
......@@ -366,3 +366,315 @@ class TestInvalidProductionRun(TestField):
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidObject1(TestField):
name = 'object1'
def test_invalid_type(self):
self.setValue(1.0)
self.setOutput(
('- [WRONG TYPE] object1 (1.0) '
'(Type must be <type \'basestring\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
def test_invalid_value(self):
self.setValue('invalid')
self.setOutput(
('- [INVALID VALUE] object1 (invalid) '
'(Value must be one of BH, NS)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidObject2(TestField):
name = 'object2'
def test_invalid_type(self):
self.setValue(1.0)
self.setOutput(
('- [WRONG TYPE] object2 (1.0) '
'(Type must be <type \'basestring\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
def test_invalid_value(self):
self.setValue('invalid')
self.setOutput(
('- [INVALID VALUE] object2 (invalid) '
'(Value must be one of BH, NS)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidMass1(TestField):
name = 'mass1'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] mass1 (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidMass2(TestField):
name = 'mass2'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] mass2 (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidEta(TestField):
name = 'eta'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] eta (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidFLowerAt1MSUN(TestField):
name = 'f_lower_at_1MSUN'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] f_lower_at_1MSUN (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidSpin1x(TestField):
name = 'spin1x'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] spin1x (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidSpin1y(TestField):
name = 'spin1y'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] spin1y (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidSpin1z(TestField):
name = 'spin1z'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] spin1z (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidSpin2x(TestField):
name = 'spin2x'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] spin2x (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidSpin2y(TestField):
name = 'spin2y'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] spin2y (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidSpin2z(TestField):
name = 'spin2z'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] spin2z (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidLNhatx(TestField):
name = 'LNhatx'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] LNhatx (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidLNhaty(TestField):
name = 'LNhaty'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] LNhaty (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidLNhatz(TestField):
name = 'LNhatz'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] LNhatz (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidNhatx(TestField):
name = 'nhatx'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] nhatx (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidNhaty(TestField):
name = 'nhaty'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] nhaty (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidNhatz(TestField):
name = 'nhatz'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] nhatz (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidOmega(TestField):
name = 'Omega'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] Omega (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidEccentricity(TestField):
name = 'eccentricity'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] eccentricity (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
class TestInvalidMeanAnomaly(TestField):
name = 'mean_anomaly'
def test_invalid_type(self):
self.setValue('invalid')
self.setOutput(
('- [WRONG TYPE] mean_anomaly (invalid) '
'(Type must be <type \'float\'>)'))
output = helper.lvcnrcheck([self.f.name])
assert output.strip() == self.output
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment