コード例 #1
0
 def test_assembler_field_tokens_multiple(self):
     "run through the matrix looking for field tokens, see if anything breaks"
     mm = matrix.CSVActionMatrix(SPRAY_ROOT + '/doc/tests/System Event-Action matrix - Matrix.csv')
     mm.update()
     ass = client.Assembler(mm, '', {})
     for eid in mm.get_event_ids():
         tokens = ass.get_event_field_tokens(eid)
         assert tokens
コード例 #2
0
 def test_assembler_undef_addr_fields_multiple(self):
     "run through the matrix, see if anything breaks"
     mm = matrix.CSVActionMatrix(SPRAY_ROOT + '/doc/tests/System Event-Action matrix - Matrix.csv')
     mm.update()
     ass = client.Assembler(mm, '', {})
     for eid in mm.get_event_ids():
         rows = mm.get_rows_for_event(eid)
         for r in rows:
             fields = ass.get_undef_addr_fields(r['event_id'], r['action_type'], r['recipient'])
             assert fields
コード例 #3
0
 def test_assembler_integration(self):
     mm = matrix.CSVActionMatrix(SPRAY_ROOT +
       '/doc/tests/System Event-Action matrix - Matrix.csv')
     mm.update()
     ass = client.Assembler(mm, 'crafter.message.sent', {})
     ret = ass.assemble()
     ret = ret  # trick lint
     self.assertEqual(ass.results, {'unfilled':
       set(['follower_email_address', 'username', 'crafter_email',
       'project_name', 'sponsor_email_address', 'sponsor_first_name',
       'copy admins_email_address', 'follower_first_name',
       'message']), 'results': {}, 'no_source': set([])})
     pass
コード例 #4
0
 def test_late_recipient_expansion_no_context(self):
     mm = matrix.CSVActionMatrix(SPRAY_ROOT + '/doc/tests/System Event-Action matrix - Matrix.csv')
     mm.update()
     ass = client.Assembler(mm, 'sponsor.project.fundingtarget', {})
     ret = ass.assemble()
     ret = ret  # trick lint
     self.maxDiff = None
     self.assertEqual(ass.results,
       {'unfilled': set(['follower_first_name', 'project_name',
       'crafter_first_name', '_tweet_address', 'crafter_email_address',
       'crafter_SMS_address', '_facebook post_address',
       'crafter_last_name',
       'project__followers_email_address',
       'project__sponsors_email_address',
       'sponsor_first_name',
       'crafter_twitter_tag', 'project_url', 'days_until_completion_date',
       'crafter_facebook post_address', 'institution']),
       'results': {},
       'no_source': set([])} )
     pass
コード例 #5
0
 def test_assembler_inst(self):
     mm = matrix.CSVActionMatrix(SPRAY_ROOT + '/doc/tests/System Event-Action matrix - Matrix.csv')
     ass = client.Assembler(mm, 'system.project.drafted', {})
     assert ass  # fool syntax checker
コード例 #6
0
 def test_assembler_undef_addr_fields_single(self):
     mm = matrix.CSVActionMatrix(SPRAY_ROOT + '/doc/tests/System Event-Action matrix - Matrix.csv')
     mm.update()
     ass = client.Assembler(mm, '', {})
     fields = ass.get_undef_addr_fields('crafter.message.sent', 'email', 'follower, copy admins')
     self.assertEqual(fields, ['follower_email_address', 'copy admins_email_address'])
コード例 #7
0
 def test_assembler_body_fields_syntax_error(self):
     mm = matrix.CSVActionMatrix(SPRAY_ROOT + '/doc/tests/System Event-Action matrix - Matrix.csv')
     ass = client.Assembler(mm, '', {})
     self.assertRaises(jinja2.TemplateSyntaxError, ass.get_undef_body_fields, "{{intentionally broken}")
コード例 #8
0
 def test_assembler_body_fields(self):
     mm = matrix.CSVActionMatrix(SPRAY_ROOT + '/doc/tests/System Event-Action matrix - Matrix.csv')
     ass = client.Assembler(mm, '', {})
     ff = ass.get_undef_body_fields("{{test}}")
     self.assertEqual(ff, ('test',))