-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
107 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
example{ | ||
writeLine("stderr", "Test output for errors."); | ||
writeLine("stdout", "Input for this rule: *in"); | ||
} | ||
|
||
input *in="This is a string or a path or etc" | ||
output ruleExecOut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from ibridges.irodsconnector.rules import execute_rule | ||
|
||
|
||
def test_rules(session, testdata): | ||
rule_fp = str(testdata/"example.r") | ||
execute_rule(session, rule_fp, {}) | ||
execute_rule(session, rule_fp, {'*in': 4, '*another_val': '"Value"'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from datetime import datetime | ||
|
||
import irods | ||
import pytest | ||
from pytest import mark | ||
|
||
from ibridges.irodsconnector.tickets import Tickets | ||
|
||
|
||
@mark.parametrize("item_name", ["collection", "dataobject"]) | ||
@mark.parametrize("ticket_type", ["read", "write"]) | ||
def test_tickets(item_name, ticket_type, session, request): | ||
item = request.getfixturevalue(item_name) | ||
ipath = item.path | ||
tickets = Tickets(session) | ||
tickets.clear() | ||
assert len(tickets.all_tickets(update=True)) == 0 | ||
|
||
exp_date = datetime.today().strftime('%Y-%m-%d.%H:%M:%S') | ||
tickets.create_ticket(str(ipath), ticket_type=ticket_type, expiry_string=exp_date) | ||
assert len(tickets.all_tickets(update=True)) == 1 | ||
ticket_str = tickets.all_ticket_strings[0] | ||
tick = tickets.get_ticket(ticket_str) | ||
assert isinstance(tick, irods.ticket.Ticket) | ||
ticket_data = tickets.all_tickets(update=True)[0] | ||
assert ticket_data[0] == ticket_str | ||
assert ticket_data[1] == ticket_type | ||
assert ticket_data[2] == str(ipath) | ||
# assert ticket_data[3] == exp_date | ||
assert isinstance(ticket_data[3], str) | ||
tickets.delete_ticket(tick) | ||
assert len(tickets.all_tickets(update=True)) == 0 | ||
with pytest.raises(KeyError): | ||
tickets.delete_ticket(tick, check=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters