def test_false_on_unknown_string(self, m_read_dmi_data): """Should return false on an unrelated string.""" m_read_dmi_data.return_value = "cubs win" ret = ay._is_aliyun() self.assertEqual(self.read_dmi_data_expected, m_read_dmi_data.call_args_list) self.assertEqual(False, ret)
def test_false_on_empty_string(self, m_read_dmi_data): """Should return false on empty value returned.""" m_read_dmi_data.return_value = "" ret = ay._is_aliyun() self.assertEqual(self.read_dmi_data_expected, m_read_dmi_data.call_args_list) self.assertEqual(False, ret)
def test_true_on_aliyun_product(self, m_read_dmi_data): """Should return true if the dmi product data has expected value.""" m_read_dmi_data.return_value = self.ALIYUN_PRODUCT ret = ay._is_aliyun() self.assertEqual(self.read_dmi_data_expected, m_read_dmi_data.call_args_list) self.assertEqual(True, ret)