示例#1
0
def test_parse_recipients_lower_case_groups():
  res = list(
      parser.parse_recipients([
          ['Email', 'Active'],
          ['*****@*****.**', 'X'],
      ]))
  assert res[0].groups == ('active', )
示例#2
0
def test_parse_recipients_skip_empty_groups():
  res = list(
      parser.parse_recipients([
          ['Email', 'Active'],
          ['*****@*****.**', ''],
      ]))
  assert res[0].groups == ()
示例#3
0
def test_parse_recipients_case_insensitive_highlights():
  res = list(
      parser.parse_recipients([
          ['Email', 'Highlight'],
          ['*****@*****.**', 'Hi'],
      ]))
  assert res[0].highlights == ('Hi', )
示例#4
0
def test_parse_recipients_skip_empty_highlights():
  res = list(
      parser.parse_recipients([
          ['Email', 'Highlight'],
          ['*****@*****.**', ''],
      ]))
  assert res[0].highlights == ()
示例#5
0
def test_parse_recipients_returns_list_of_recipients_no_default_values():
  res = parser.parse_recipients([
      ['Email'],
      ['*****@*****.**'],
  ])
  for recipient in res:
    assert isinstance(recipient, Recipient)
    assert recipient.groups == ()
    assert recipient.highlights == ()
示例#6
0
def test_parse_recipients_returns_list_of_recipients_no_default_values():
  res = parser.parse_recipients([
      ['Email'],
      ['*****@*****.**'],
      ])
  for recipient in res:
    assert isinstance(recipient, Recipient)
    assert recipient.groups == ()
    assert recipient.highlights == ()
示例#7
0
def test_parse_recipients_skips_empty_emails():
  assert not list(parser.parse_recipients([
      ['Email'],
      [''],
  ]))
示例#8
0
def test_parse_recipients_returns_empty_if_none():
  assert not list(parser.parse_recipients(None))
示例#9
0
def test_parse_recipients_skips_empty_rows():
  assert not list(parser.parse_recipients([
      ['Email'],
      [],
      ]))
示例#10
0
def test_parse_recipients_returns_empty_if_none():
  assert not list(parser.parse_recipients(None))
示例#11
0
def test_parse_recipients_skip_empty_groups():
  res = list(parser.parse_recipients([
      ['Email', 'Active'],
      ['*****@*****.**', ''],
      ]))
  assert res[0].groups == ()
示例#12
0
def test_parse_recipients_lower_case_groups():
  res = list(parser.parse_recipients([
      ['Email', 'Active'],
      ['*****@*****.**', 'X'],
      ]))
  assert res[0].groups == ('active',)
示例#13
0
def test_parse_recipients_skip_empty_highlights():
  res = list(parser.parse_recipients([
      ['Email', 'Highlight'],
      ['*****@*****.**', ''],
      ]))
  assert res[0].highlights == ()
示例#14
0
def test_parse_recipients_case_insensitive_highlights():
  res = list(parser.parse_recipients([
      ['Email', 'Highlight'],
      ['*****@*****.**', 'Hi'],
      ]))
  assert res[0].highlights == ('Hi',)