Esempio n. 1
0
def test_parse_recipients_lower_case_groups():
  res = list(
      parser.parse_recipients([
          ['Email', 'Active'],
          ['*****@*****.**', 'X'],
      ]))
  assert res[0].groups == ('active', )
Esempio n. 2
0
def test_parse_recipients_skip_empty_groups():
  res = list(
      parser.parse_recipients([
          ['Email', 'Active'],
          ['*****@*****.**', ''],
      ]))
  assert res[0].groups == ()
Esempio n. 3
0
def test_parse_recipients_case_insensitive_highlights():
  res = list(
      parser.parse_recipients([
          ['Email', 'Highlight'],
          ['*****@*****.**', 'Hi'],
      ]))
  assert res[0].highlights == ('Hi', )
Esempio n. 4
0
def test_parse_recipients_skip_empty_highlights():
  res = list(
      parser.parse_recipients([
          ['Email', 'Highlight'],
          ['*****@*****.**', ''],
      ]))
  assert res[0].highlights == ()
Esempio n. 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 == ()
Esempio n. 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 == ()
Esempio n. 7
0
def test_parse_recipients_skips_empty_emails():
  assert not list(parser.parse_recipients([
      ['Email'],
      [''],
  ]))
Esempio n. 8
0
def test_parse_recipients_returns_empty_if_none():
  assert not list(parser.parse_recipients(None))
Esempio n. 9
0
def test_parse_recipients_skips_empty_rows():
  assert not list(parser.parse_recipients([
      ['Email'],
      [],
      ]))
Esempio n. 10
0
def test_parse_recipients_returns_empty_if_none():
  assert not list(parser.parse_recipients(None))
Esempio n. 11
0
def test_parse_recipients_skip_empty_groups():
  res = list(parser.parse_recipients([
      ['Email', 'Active'],
      ['*****@*****.**', ''],
      ]))
  assert res[0].groups == ()
Esempio n. 12
0
def test_parse_recipients_lower_case_groups():
  res = list(parser.parse_recipients([
      ['Email', 'Active'],
      ['*****@*****.**', 'X'],
      ]))
  assert res[0].groups == ('active',)
Esempio n. 13
0
def test_parse_recipients_skip_empty_highlights():
  res = list(parser.parse_recipients([
      ['Email', 'Highlight'],
      ['*****@*****.**', ''],
      ]))
  assert res[0].highlights == ()
Esempio n. 14
0
def test_parse_recipients_case_insensitive_highlights():
  res = list(parser.parse_recipients([
      ['Email', 'Highlight'],
      ['*****@*****.**', 'Hi'],
      ]))
  assert res[0].highlights == ('Hi',)