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