コード例 #1
0
    def test_instance_is_stopped(self):
        instance_info = InstanceInfo(
            name="instance-name",
            state="STOPPED",
            image_release="16.04 LTS",
            mounts=dict(),
        )

        self.assertThat(instance_info.is_stopped(), Equals(True))
コード例 #2
0
ファイル: test_instance_info.py プロジェクト: mvo5/snapcraft
    def test_initialize(self):
        instance_info = InstanceInfo(
            name="instance-name", state="RUNNING", image_release="16.04 LTS"
        )

        self.assertThat(instance_info.name, Equals("instance-name"))
        self.assertThat(instance_info.state, Equals("RUNNING"))
        self.assertThat(instance_info.image_release, Equals("16.04 LTS"))
        self.assertThat(instance_info.is_stopped(), Equals(False))
コード例 #3
0
    def test_initialize(self):
        instance_info = InstanceInfo(name="instance-name",
                                     state="RUNNING",
                                     image_release="16.04 LTS")

        self.assertThat(instance_info.name, Equals("instance-name"))
        self.assertThat(instance_info.state, Equals("RUNNING"))
        self.assertThat(instance_info.image_release, Equals("16.04 LTS"))
        self.assertThat(instance_info.is_stopped(), Equals(False))
コード例 #4
0
    def test_initialize(self):
        instance_info = InstanceInfo(name='instance-name',
                                     state='RUNNING',
                                     image_release='16.04 LTS')

        self.assertThat(instance_info.name, Equals('instance-name'))
        self.assertThat(instance_info.state, Equals('RUNNING'))
        self.assertThat(instance_info.image_release, Equals('16.04 LTS'))
        self.assertThat(instance_info.is_stopped(), Equals(False))
コード例 #5
0
    def test_instance_is_mounted(self):
        instance_info = InstanceInfo(
            name="instance-name",
            state="STOPPED",
            image_release="16.04 LTS",
            mounts=dict(project=dict()),
        )

        self.assertThat(instance_info.is_mounted("project"), Equals(True))
        self.assertThat(instance_info.is_mounted("not-project"), Equals(False))
コード例 #6
0
    def test_new_instance_from_unmarshalled_json(self):
        instance_info = InstanceInfo.from_json(
            instance_name=self.instance_name, json_info=self.json_string)

        self.assertThat(instance_info.name, Equals(self.instance_name))
        self.assertThat(instance_info.state, Equals("RUNNING"))
        self.assertThat(instance_info.image_release, Equals("16.04 LTS"))
コード例 #7
0
ファイル: test_instance_info.py プロジェクト: mvo5/snapcraft
    def test_new_instance_from_unmarshalled_json(self):
        instance_info = InstanceInfo.from_json(
            instance_name=self.instance_name, json_info=self.json_string
        )

        self.assertThat(instance_info.name, Equals(self.instance_name))
        self.assertThat(instance_info.state, Equals("RUNNING"))
        self.assertThat(instance_info.image_release, Equals("16.04 LTS"))
コード例 #8
0
ファイル: test_instance_info.py プロジェクト: mvo5/snapcraft
    def test_instance_is_stopped(self):
        instance_info = InstanceInfo(
            name="instance-name", state="STOPPED", image_release="16.04 LTS"
        )

        self.assertThat(instance_info.is_stopped(), Equals(True))
コード例 #9
0
    def test_instance_is_stopped(self):
        instance_info = InstanceInfo(name='instance-name',
                                     state='STOPPED',
                                     image_release='16.04 LTS')

        self.assertThat(instance_info.is_stopped(), Equals(True))