Exemple #1
0
 def test__get_script_from_template(self, m_sio, m_gs):
     m_gs.return_value = fake_script = mock.Mock()
     fake_script.read.return_value = 'fake_data {k1} {k2}'
     m_sio.return_value = 'fake_formatted_script'
     script = lxc._get_script_from_template('fake_tpl', k1='v1', k2='v2')
     self.assertEqual('fake_formatted_script', script)
     m_sio.assert_called_once_with('fake_data v1 v2')
Exemple #2
0
 def test__get_script_from_template(self, m_sio, m_gs):
     m_gs.return_value = fake_script = mock.Mock()
     fake_script.read.return_value = 'fake_data {k1} {k2}'
     m_sio.return_value = 'fake_formatted_script'
     script = lxc._get_script_from_template('fake_tpl', k1='v1', k2='v2')
     self.assertEqual('fake_formatted_script', script)
     m_sio.assert_called_once_with('fake_data v1 v2')
Exemple #3
0
 def test__get_script_from_template(self, mock_string_io, mock__get_script):
     mock__get_script.return_value = fake_script = mock.Mock()
     fake_script.read.return_value = "fake_data {k1} {k2}"
     mock_string_io.return_value = "fake_formatted_script"
     script = lxc._get_script_from_template("fake_tpl", k1="v1", k2="v2")
     self.assertEqual("fake_formatted_script", script)
     mock_string_io.assert_called_once_with("fake_data v1 v2")
Exemple #4
0
 def test__get_script_from_template(self, m_sio, m_gs):
     m_gs.return_value = fake_script = mock.Mock()
     fake_script.read.return_value = "fake_data {k1} {k2}"
     m_sio.return_value = "fake_formatted_script"
     script = lxc._get_script_from_template("fake_tpl", k1="v1", k2="v2")
     self.assertEqual("fake_formatted_script", script)
     m_sio.assert_called_once_with("fake_data v1 v2")