def test_get_raw_dict_is_a_copy(self): snapcraft_yaml_file_path = self.make_snapcraft_yaml( dedent("""\ name: foo version: "1" summary: bar description: baz confinement: strict """)) info = ProjectInfo(snapcraft_yaml_file_path=snapcraft_yaml_file_path) raw_snapcraft = info.get_raw_snapcraft() raw_snapcraft.pop("name") self.assertThat(raw_snapcraft.get("name"), Is(None)) raw_snapcraft = info.get_raw_snapcraft() self.assertThat(raw_snapcraft.get("name"), Equals("foo"))
def test_get_raw_dict_is_a_copy(self): snapcraft_yaml_file_path = self.make_snapcraft_yaml( dedent( """\ name: foo version: "1" summary: bar description: baz confinement: strict """ ) ) info = ProjectInfo(snapcraft_yaml_file_path=snapcraft_yaml_file_path) raw_snapcraft = info.get_raw_snapcraft() raw_snapcraft.pop("name") self.assertThat(raw_snapcraft.get("name"), Is(None)) raw_snapcraft = info.get_raw_snapcraft() self.assertThat(raw_snapcraft.get("name"), Equals("foo"))
def test_get_raw_dict(self): snapcraft_yaml_file_path = self.make_snapcraft_yaml( dedent("""\ name: foo version: "1" summary: bar description: baz confinement: strict """)) info = ProjectInfo(snapcraft_yaml_file_path=snapcraft_yaml_file_path) raw_snapcraft = info.get_raw_snapcraft() self.assertThat(raw_snapcraft["name"], Equals("foo")) self.assertThat(raw_snapcraft["version"], Equals("1")) self.assertThat(raw_snapcraft["summary"], Equals("bar")) self.assertThat(raw_snapcraft["description"], Equals("baz")) self.assertThat(raw_snapcraft["confinement"], Equals("strict"))
def test_get_raw_dict(self): snapcraft_yaml_file_path = self.make_snapcraft_yaml( dedent( """\ name: foo version: "1" summary: bar description: baz confinement: strict """ ) ) info = ProjectInfo(snapcraft_yaml_file_path=snapcraft_yaml_file_path) raw_snapcraft = info.get_raw_snapcraft() self.assertThat(raw_snapcraft["name"], Equals("foo")) self.assertThat(raw_snapcraft["version"], Equals("1")) self.assertThat(raw_snapcraft["summary"], Equals("bar")) self.assertThat(raw_snapcraft["description"], Equals("baz")) self.assertThat(raw_snapcraft["confinement"], Equals("strict"))