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