def test_build_test_execution_commands_standard(self):
        """Test building commands based on standard, valid input."""
        exp = (["starcluster -c sc_config start nightly_tests"],
               ["starcluster -c sc_config sshmaster -u ubuntu nightly_tests "
                "'source /bin/setup.sh; cd /bin; ./tests.py'",
               "starcluster -c sc_config sshmaster -u ubuntu nightly_tests "
               "'/bin/cogent_tests'"],
               ["starcluster -c sc_config terminate -c nightly_tests"])

        test_suites = _parse_config_file(self.config1)
        obs = _build_test_execution_commands(test_suites, 'sc_config',
                'ubuntu', 'nightly_tests')
        self.assertEqual(obs, exp)
    def test_build_test_execution_commands_custom_cluster_template(self):
        """Test building commands using a non-default cluster template."""
        exp = (["starcluster -c sc_config start -c some_cluster_template "
                "nightly_tests"],
               ["starcluster -c sc_config sshmaster -u ubuntu nightly_tests "
                "'source /bin/setup.sh; cd /bin; ./tests.py'",
                "starcluster -c sc_config sshmaster -u ubuntu nightly_tests "
                "'/bin/cogent_tests'"],
               ["starcluster -c sc_config terminate -c nightly_tests"])

        test_suites = _parse_config_file(self.config1)
        obs = _build_test_execution_commands(test_suites, 'sc_config',
                'ubuntu', 'nightly_tests', 'some_cluster_template')
        self.assertEqual(obs, exp)
 def test_parse_config_file_standard(self):
     """Test parsing a standard config file."""
     exp = [['QIIME', 'source /bin/setup.sh; cd /bin; ./tests.py'],
            ['PyCogent', '/bin/cogent_tests']]
     obs = _parse_config_file(self.config1)
     self.assertEqual(obs, exp)