示例#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
    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))
    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
    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
    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))