mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-22 20:58:28 +00:00
Simple test for get_localtime script
This commit is contained in:
parent
c2c79bd014
commit
fc3e7f8183
@ -5,23 +5,7 @@
|
|||||||
<bpmn:outgoing>Flow_0lnc9x0</bpmn:outgoing>
|
<bpmn:outgoing>Flow_0lnc9x0</bpmn:outgoing>
|
||||||
</bpmn:startEvent>
|
</bpmn:startEvent>
|
||||||
<bpmn:sequenceFlow id="Flow_0lnc9x0" sourceRef="StartEvent_1" targetRef="Activity_0aq21yg" />
|
<bpmn:sequenceFlow id="Flow_0lnc9x0" sourceRef="StartEvent_1" targetRef="Activity_0aq21yg" />
|
||||||
<bpmn:task id="Activity_1by2ose" name="Get Localtime">
|
|
||||||
<bpmn:documentation>timestamp = email_model.timestamp
|
|
||||||
localtime = get_localtime(timestamp)</bpmn:documentation>
|
|
||||||
<bpmn:incoming>Flow_0gtgzcf</bpmn:incoming>
|
|
||||||
<bpmn:outgoing>Flow_0k1hbif</bpmn:outgoing>
|
|
||||||
</bpmn:task>
|
|
||||||
<bpmn:sequenceFlow id="Flow_0gtgzcf" sourceRef="Activity_0aq21yg" targetRef="Activity_1by2ose" />
|
<bpmn:sequenceFlow id="Flow_0gtgzcf" sourceRef="Activity_0aq21yg" targetRef="Activity_1by2ose" />
|
||||||
<bpmn:task id="Activity_0d5fjpa" name="Display Times">
|
|
||||||
<bpmn:documentation># Timestamp
|
|
||||||
{{ timestamp }}
|
|
||||||
|
|
||||||
|
|
||||||
# Localtime
|
|
||||||
{{ localtime }}</bpmn:documentation>
|
|
||||||
<bpmn:incoming>Flow_0k1hbif</bpmn:incoming>
|
|
||||||
<bpmn:outgoing>Flow_0kgtoh1</bpmn:outgoing>
|
|
||||||
</bpmn:task>
|
|
||||||
<bpmn:sequenceFlow id="Flow_0k1hbif" sourceRef="Activity_1by2ose" targetRef="Activity_0d5fjpa" />
|
<bpmn:sequenceFlow id="Flow_0k1hbif" sourceRef="Activity_1by2ose" targetRef="Activity_0d5fjpa" />
|
||||||
<bpmn:endEvent id="Event_1vxo45i">
|
<bpmn:endEvent id="Event_1vxo45i">
|
||||||
<bpmn:incoming>Flow_0kgtoh1</bpmn:incoming>
|
<bpmn:incoming>Flow_0kgtoh1</bpmn:incoming>
|
||||||
@ -33,6 +17,24 @@ localtime = get_localtime(timestamp)</bpmn:documentation>
|
|||||||
<bpmn:outgoing>Flow_0gtgzcf</bpmn:outgoing>
|
<bpmn:outgoing>Flow_0gtgzcf</bpmn:outgoing>
|
||||||
<bpmn:script>email_model = email(subject='My Email Subject', recipients='user@example.com')</bpmn:script>
|
<bpmn:script>email_model = email(subject='My Email Subject', recipients='user@example.com')</bpmn:script>
|
||||||
</bpmn:scriptTask>
|
</bpmn:scriptTask>
|
||||||
|
<bpmn:scriptTask id="Activity_1by2ose" name="Get Localtime">
|
||||||
|
<bpmn:documentation>timestamp = email_model.timestamp
|
||||||
|
localtime = get_localtime(str(timestamp))</bpmn:documentation>
|
||||||
|
<bpmn:incoming>Flow_0gtgzcf</bpmn:incoming>
|
||||||
|
<bpmn:outgoing>Flow_0k1hbif</bpmn:outgoing>
|
||||||
|
<bpmn:script>timestamp=email_model.timestamp
|
||||||
|
localtime = get_localtime(timestamp=timestamp)</bpmn:script>
|
||||||
|
</bpmn:scriptTask>
|
||||||
|
<bpmn:manualTask id="Activity_0d5fjpa" name="Display Times">
|
||||||
|
<bpmn:documentation># Timestamp
|
||||||
|
{{ timestamp }}
|
||||||
|
|
||||||
|
|
||||||
|
# Localtime
|
||||||
|
{{ localtime }}</bpmn:documentation>
|
||||||
|
<bpmn:incoming>Flow_0k1hbif</bpmn:incoming>
|
||||||
|
<bpmn:outgoing>Flow_0kgtoh1</bpmn:outgoing>
|
||||||
|
</bpmn:manualTask>
|
||||||
</bpmn:process>
|
</bpmn:process>
|
||||||
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
||||||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1dxw783">
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1dxw783">
|
||||||
@ -55,18 +57,18 @@ localtime = get_localtime(timestamp)</bpmn:documentation>
|
|||||||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
|
||||||
<dc:Bounds x="179" y="99" width="36" height="36" />
|
<dc:Bounds x="179" y="99" width="36" height="36" />
|
||||||
</bpmndi:BPMNShape>
|
</bpmndi:BPMNShape>
|
||||||
<bpmndi:BPMNShape id="Activity_1by2ose_di" bpmnElement="Activity_1by2ose">
|
|
||||||
<dc:Bounds x="430" y="77" width="100" height="80" />
|
|
||||||
</bpmndi:BPMNShape>
|
|
||||||
<bpmndi:BPMNShape id="Activity_0d5fjpa_di" bpmnElement="Activity_0d5fjpa">
|
|
||||||
<dc:Bounds x="590" y="77" width="100" height="80" />
|
|
||||||
</bpmndi:BPMNShape>
|
|
||||||
<bpmndi:BPMNShape id="Event_1vxo45i_di" bpmnElement="Event_1vxo45i">
|
<bpmndi:BPMNShape id="Event_1vxo45i_di" bpmnElement="Event_1vxo45i">
|
||||||
<dc:Bounds x="752" y="99" width="36" height="36" />
|
<dc:Bounds x="752" y="99" width="36" height="36" />
|
||||||
</bpmndi:BPMNShape>
|
</bpmndi:BPMNShape>
|
||||||
<bpmndi:BPMNShape id="Activity_01qg6wo_di" bpmnElement="Activity_0aq21yg">
|
<bpmndi:BPMNShape id="Activity_01qg6wo_di" bpmnElement="Activity_0aq21yg">
|
||||||
<dc:Bounds x="270" y="77" width="100" height="80" />
|
<dc:Bounds x="270" y="77" width="100" height="80" />
|
||||||
</bpmndi:BPMNShape>
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape id="Activity_0q4ycxr_di" bpmnElement="Activity_1by2ose">
|
||||||
|
<dc:Bounds x="430" y="77" width="100" height="80" />
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape id="Activity_178gn50_di" bpmnElement="Activity_0d5fjpa">
|
||||||
|
<dc:Bounds x="590" y="77" width="100" height="80" />
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
</bpmndi:BPMNPlane>
|
</bpmndi:BPMNPlane>
|
||||||
</bpmndi:BPMNDiagram>
|
</bpmndi:BPMNDiagram>
|
||||||
</bpmn:definitions>
|
</bpmn:definitions>
|
||||||
|
@ -1,21 +1,17 @@
|
|||||||
from tests.base_test import BaseTest
|
from tests.base_test import BaseTest
|
||||||
from crc.models.file import FileDataModel
|
from crc.scripts.get_localtime import GetLocaltime
|
||||||
from crc import session
|
|
||||||
|
|
||||||
|
|
||||||
class TestGetLocaltime(BaseTest):
|
class TestGetLocaltime(BaseTest):
|
||||||
|
|
||||||
def test_get_localtime(self):
|
def test_get_localtime(self):
|
||||||
self.load_example_data()
|
self.load_example_data()
|
||||||
# file_model = session.query(FileDataModel).first()
|
|
||||||
# test_time = file_model.date_created
|
|
||||||
|
|
||||||
workflow = self.create_workflow('get_localtime')
|
workflow = self.create_workflow('get_localtime')
|
||||||
workflow_api = self.get_workflow_api(workflow)
|
workflow_api = self.get_workflow_api(workflow)
|
||||||
task = workflow_api.next_task
|
task = workflow_api.next_task
|
||||||
# workflow_api = self.complete_form(workflow, task, {'timestamp': test_time})
|
|
||||||
|
|
||||||
# local_time =
|
timestamp = task.data['timestamp']
|
||||||
|
localtime = task.data['localtime']
|
||||||
print('test_get_localtime')
|
|
||||||
|
|
||||||
|
self.assertEqual(localtime, GetLocaltime().do_task(None, None, None, timestamp=timestamp))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user