def test_status(self):
        docker_provisioner = provisioners.DockerProvisioner(
            self._mock_molecule)

        docker_provisioner.up()

        self.assertEquals('test1', docker_provisioner.status()[1].name)
        self.assertEquals('test2', docker_provisioner.status()[0].name)

        self.assertIn('Up', docker_provisioner.status()[1].state)
        self.assertIn('Up', docker_provisioner.status()[0].state)

        self.assertEqual('docker', docker_provisioner.status()[0].provider)
        self.assertEqual('docker', docker_provisioner.status()[1].provider)
    def test_provision(self):

        docker_provisioner = provisioners.DockerProvisioner(
            self._mock_molecule)
        docker_provisioner.destroy()
        docker_provisioner.up()

        self.book = docker_provisioner.ansible_connection_params
        self.book['playbook'] = 'tests/playbook.yml'
        self.book['inventory'] = 'test1,test2,'

        self.ansible = AnsiblePlaybook(self.book)

        self.assertEqual((None, ''), self.ansible.execute())

        docker_provisioner.destroy()
    def test_destroy(self):
        docker_provisioner = provisioners.DockerProvisioner(
            self._mock_molecule)

        docker_provisioner.up()

        self.assertEquals('test1', docker_provisioner.status()[1].name)
        self.assertEquals('test2', docker_provisioner.status()[0].name)

        self.assertIn('Up', docker_provisioner.status()[1].state)
        self.assertIn('Up', docker_provisioner.status()[0].state)

        docker_provisioner.destroy()

        self.assertIn('Not Created', docker_provisioner.status()[1].state)
        self.assertIn('Not Created', docker_provisioner.status()[0].state)
 def test_instances(self):
     docker_provisioner = provisioners.DockerProvisioner(
         self._mock_molecule)
     self.assertEqual(docker_provisioner.instances[0]['name'], 'test1')
     self.assertEqual(docker_provisioner.instances[1]['name'], 'test2')
 def test_up(self):
     docker_provisioner = provisioners.DockerProvisioner(
         self._mock_molecule)
     docker_provisioner.up()
     docker_provisioner.destroy()
 def test_name(self):
     docker_provisioner = provisioners.DockerProvisioner(
         self._mock_molecule)
     # false values don't exist in arg dict at all
     self.assertEqual(docker_provisioner.name, 'docker')