diff --git a/tests/fixtures/mapping-rules.yml b/tests/fixtures/mapping-rules.yml index bf83195..77b31ee 100644 --- a/tests/fixtures/mapping-rules.yml +++ b/tests/fixtures/mapping-rules.yml @@ -42,6 +42,9 @@ users: scheduling: require: - pulsar + krikkitrobot@planetkrikkit.org: + env: + TEST_JOB_SLOTS_USER: "{cores}" arthur@vortex.org: scheduling: require: diff --git a/tests/test_shell.py b/tests/test_shell.py index 05ac97b..2ecbaed 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -285,7 +285,7 @@ def test_dry_run_user_email(self): job_config = os.path.join(os.path.dirname(__file__), 'fixtures/job_conf_dry_run.yml') tpv_config = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-rules.yml') output = self.call_shell_command( - "tpv", "dry-run", "--job-conf", job_config, "--input-size", "6", "--user", "fairycake@vortex.org", + "tpv", "dry-run", "--job-conf", job_config, "--input-size", "6", "--user", "krikkitrobot@planetkrikkit.org", tpv_config) - self.assertTrue("name: TEST_JOB_SLOTS" in output, - f"Expected 'name: TEST_JOB_SLOTS' in destination\n{output}") + self.assertTrue("name: TEST_JOB_SLOTS_USER" in output, + f"Expected 'name: TEST_JOB_SLOTS_USER' in destination\n{output}") diff --git a/tpv/commands/dryrunner.py b/tpv/commands/dryrunner.py index 214ab95..deee0f3 100644 --- a/tpv/commands/dryrunner.py +++ b/tpv/commands/dryrunner.py @@ -23,11 +23,8 @@ def run(self): @staticmethod def from_params(job_conf, user=None, tool=None, tpv_confs=None, input_size=None): if user is not None: - if '@' in user: - username, email = user.split('@', 1) - else: - username, email = (user, 'example.org') - user = mock_galaxy.User(username, email) + email = user + user = mock_galaxy.User('gargravarr', email) else: user = None