def test_scofield_dispatch(self, mock_func): """Check parametrised weightings are dispatched correctly""" self.assertEqual(get_cross_sections(42), (42., None, 'SCOFIELD')) self.assertEqual(get_cross_sections('1.4e2', elements=['Sc', 'O']), (1.4e2, ['Sc', 'O'], 'SCOFIELD'))
def test_json_dispatch(self, mock_func): """Check JSON weighting files are dispatched correctly""" json_file = 'nonexistent.json' self.assertEqual(get_cross_sections(json_file), (json_file, 'JSON')) self.assertEqual(get_cross_sections(json_file, elements=['Na']), (json_file, 'JSON'))
def test_yeh_old_keys(self): with self.assertRaises(ValueError): get_cross_sections('xps') with self.assertRaises(ValueError): get_cross_sections('ups') with self.assertRaises(ValueError): get_cross_sections('haxpes')
def test_yeh_dispatch(self, mock_func): """Check tabulated weightings are dispatched correctly""" self.assertEqual(get_cross_sections('alka'), ('alka', 'YEH'))