def test_adds(self): m = InstallManifest() m.add_symlink('s_source', 's_dest') m.add_copy('c_source', 'c_dest') m.add_required_exists('e_dest') m.add_optional_exists('o_dest') m.add_pattern_symlink('ps_base', 'ps/*', 'ps_dest') m.add_pattern_copy('pc_base', 'pc/**', 'pc_dest') self.assertEqual(len(m), 6) self.assertIn('s_dest', m) self.assertIn('c_dest', m) self.assertIn('e_dest', m) self.assertIn('o_dest', m) with self.assertRaises(ValueError): m.add_symlink('s_other', 's_dest') with self.assertRaises(ValueError): m.add_copy('c_other', 'c_dest') with self.assertRaises(ValueError): m.add_required_exists('e_dest') with self.assertRaises(ValueError): m.add_optional_exists('o_dest') with self.assertRaises(ValueError): m.add_pattern_symlink('ps_base', 'ps/*', 'ps_dest') with self.assertRaises(ValueError): m.add_pattern_copy('pc_base', 'pc/**', 'pc_dest')
def _get_test_manifest(self): m = InstallManifest() m.add_symlink(self.tmppath('s_source'), 's_dest') m.add_copy(self.tmppath('c_source'), 'c_dest') m.add_required_exists('e_dest') m.add_optional_exists('o_dest') return m
def _get_test_manifest(self): m = InstallManifest() m.add_symlink(self.tmppath('s_source'), 's_dest') m.add_copy(self.tmppath('c_source'), 'c_dest') m.add_preprocess(self.tmppath('p_source'), 'p_dest', self.tmppath('p_source.pp'), '#', {'FOO':'BAR', 'BAZ':'QUX'}) m.add_required_exists('e_dest') m.add_optional_exists('o_dest') m.add_pattern_symlink('ps_base', '*', 'ps_dest') m.add_pattern_copy('pc_base', '**', 'pc_dest') return m
def _get_test_manifest(self): m = InstallManifest() m.add_link(self.tmppath('s_source'), 's_dest') m.add_copy(self.tmppath('c_source'), 'c_dest') m.add_preprocess(self.tmppath('p_source'), 'p_dest', self.tmppath('p_source.pp'), '#', {'FOO':'BAR', 'BAZ':'QUX'}) m.add_required_exists('e_dest') m.add_optional_exists('o_dest') m.add_pattern_link('ps_base', '*', 'ps_dest') m.add_pattern_copy('pc_base', '**', 'pc_dest') m.add_content('the content\non\nmultiple lines', 'content') return m
def _get_test_manifest(self): m = InstallManifest() m.add_symlink(self.tmppath("s_source"), "s_dest") m.add_copy(self.tmppath("c_source"), "c_dest") m.add_preprocess( self.tmppath("p_source"), "p_dest", self.tmppath("p_source.pp"), "#", {"FOO": "BAR", "BAZ": "QUX"} ) m.add_required_exists("e_dest") m.add_optional_exists("o_dest") m.add_pattern_symlink("ps_base", "*", "ps_dest") m.add_pattern_copy("pc_base", "**", "pc_dest") return m
def test_adds(self): m = InstallManifest() m.add_link("s_source", "s_dest") m.add_copy("c_source", "c_dest") m.add_required_exists("e_dest") m.add_optional_exists("o_dest") m.add_pattern_link("ps_base", "ps/*", "ps_dest") m.add_pattern_copy("pc_base", "pc/**", "pc_dest") m.add_preprocess("p_source", "p_dest", "p_source.pp") m.add_content("content", "content") self.assertEqual(len(m), 8) self.assertIn("s_dest", m) self.assertIn("c_dest", m) self.assertIn("p_dest", m) self.assertIn("e_dest", m) self.assertIn("o_dest", m) self.assertIn("content", m) with self.assertRaises(ValueError): m.add_link("s_other", "s_dest") with self.assertRaises(ValueError): m.add_copy("c_other", "c_dest") with self.assertRaises(ValueError): m.add_preprocess("p_other", "p_dest", "p_other.pp") with self.assertRaises(ValueError): m.add_required_exists("e_dest") with self.assertRaises(ValueError): m.add_optional_exists("o_dest") with self.assertRaises(ValueError): m.add_pattern_link("ps_base", "ps/*", "ps_dest") with self.assertRaises(ValueError): m.add_pattern_copy("pc_base", "pc/**", "pc_dest") with self.assertRaises(ValueError): m.add_content("content", "content")
def _get_test_manifest(self): m = InstallManifest() m.add_link(self.tmppath("s_source"), "s_dest") m.add_copy(self.tmppath("c_source"), "c_dest") m.add_preprocess( self.tmppath("p_source"), "p_dest", self.tmppath("p_source.pp"), "#", { "FOO": "BAR", "BAZ": "QUX" }, ) m.add_required_exists("e_dest") m.add_optional_exists("o_dest") m.add_pattern_link("ps_base", "*", "ps_dest") m.add_pattern_copy("pc_base", "**", "pc_dest") m.add_content("the content\non\nmultiple lines", "content") return m
def test_adds(self): m = InstallManifest() m.add_symlink("s_source", "s_dest") m.add_copy("c_source", "c_dest") m.add_required_exists("e_dest") m.add_optional_exists("o_dest") m.add_pattern_symlink("ps_base", "ps/*", "ps_dest") m.add_pattern_copy("pc_base", "pc/**", "pc_dest") m.add_preprocess("p_source", "p_dest", "p_source.pp") self.assertEqual(len(m), 7) self.assertIn("s_dest", m) self.assertIn("c_dest", m) self.assertIn("p_dest", m) self.assertIn("e_dest", m) self.assertIn("o_dest", m) with self.assertRaises(ValueError): m.add_symlink("s_other", "s_dest") with self.assertRaises(ValueError): m.add_copy("c_other", "c_dest") with self.assertRaises(ValueError): m.add_preprocess("p_other", "p_dest", "p_other.pp") with self.assertRaises(ValueError): m.add_required_exists("e_dest") with self.assertRaises(ValueError): m.add_optional_exists("o_dest") with self.assertRaises(ValueError): m.add_pattern_symlink("ps_base", "ps/*", "ps_dest") with self.assertRaises(ValueError): m.add_pattern_copy("pc_base", "pc/**", "pc_dest")