"""Tests for vectors."""

from sympy import sympify

from drudge import Vec


def test_vecs_has_basic_properties():
    """Tests the basic properties of vector instances."""

    base = Vec('v')
    v_ab = Vec('v', indices=['a', 'b'])
    v_ab_1 = base['a', 'b']
    v_ab_2 = (base['a'])['b']

    indices_ref = (sympify('a'), sympify('b'))
    hash_ref = hash(v_ab)
    str_ref = 'v[a, b]'
    repr_ref = "Vec('v', (a, b))"

    for i in [v_ab, v_ab_1, v_ab_2]:
        assert i.label == base.label
        assert i.base == base
        assert i.indices == indices_ref
        assert hash(i) == hash_ref
        assert i == v_ab
        assert str(i) == str_ref
        assert repr(i) == repr_ref

"""Tests for vectors."""

import pytest

from sympy import sympify

from drudge import Vec


def test_vecs_has_basic_properties():
    """Tests the basic properties of vector instances."""

    base = Vec('v')
    v_ab = Vec('v', indices=['a', 'b'])
    v_ab_1 = base['a', 'b']
    v_ab_2 = (base['a'])['b']

    indices_ref = (sympify('a'), sympify('b'))
    hash_ref = hash(v_ab)
    str_ref = 'v[a, b]'
    repr_ref = "Vec('v', (a, b))"

    for i in [v_ab, v_ab_1, v_ab_2]:
        assert i.label == base.label
        assert i.base == base
        assert i.indices == indices_ref
        assert hash(i) == hash_ref
        assert i == v_ab
        assert str(i) == str_ref
        assert repr(i) == repr_ref

        # Vectors should not be sympified.
        with pytest.raises(TypeError):
            sympify(i)

Add tests for disabled sympification of vectors
Add tests for disabled sympification of vectors

  """Tests for vectors."""
+ 
+ import pytest
  
  from sympy import sympify
  
  from drudge import Vec
  
  
  def test_vecs_has_basic_properties():
      """Tests the basic properties of vector instances."""
  
      base = Vec('v')
      v_ab = Vec('v', indices=['a', 'b'])
      v_ab_1 = base['a', 'b']
      v_ab_2 = (base['a'])['b']
  
      indices_ref = (sympify('a'), sympify('b'))
      hash_ref = hash(v_ab)
      str_ref = 'v[a, b]'
      repr_ref = "Vec('v', (a, b))"
  
      for i in [v_ab, v_ab_1, v_ab_2]:
          assert i.label == base.label
          assert i.base == base
          assert i.indices == indices_ref
          assert hash(i) == hash_ref
          assert i == v_ab
          assert str(i) == str_ref
          assert repr(i) == repr_ref
  
+         # Vectors should not be sympified.
+         with pytest.raises(TypeError):
+             sympify(i)
+ 
Add tests for disabled sympification of vectors
## Code Before:
"""Tests for vectors."""

from sympy import sympify

from drudge import Vec


def test_vecs_has_basic_properties():
    """Tests the basic properties of vector instances."""

    base = Vec('v')
    v_ab = Vec('v', indices=['a', 'b'])
    v_ab_1 = base['a', 'b']
    v_ab_2 = (base['a'])['b']

    indices_ref = (sympify('a'), sympify('b'))
    hash_ref = hash(v_ab)
    str_ref = 'v[a, b]'
    repr_ref = "Vec('v', (a, b))"

    for i in [v_ab, v_ab_1, v_ab_2]:
        assert i.label == base.label
        assert i.base == base
        assert i.indices == indices_ref
        assert hash(i) == hash_ref
        assert i == v_ab
        assert str(i) == str_ref
        assert repr(i) == repr_ref

## Instruction:
Add tests for disabled sympification of vectors
## Code After:
"""Tests for vectors."""

import pytest

from sympy import sympify

from drudge import Vec


def test_vecs_has_basic_properties():
    """Tests the basic properties of vector instances."""

    base = Vec('v')
    v_ab = Vec('v', indices=['a', 'b'])
    v_ab_1 = base['a', 'b']
    v_ab_2 = (base['a'])['b']

    indices_ref = (sympify('a'), sympify('b'))
    hash_ref = hash(v_ab)
    str_ref = 'v[a, b]'
    repr_ref = "Vec('v', (a, b))"

    for i in [v_ab, v_ab_1, v_ab_2]:
        assert i.label == base.label
        assert i.base == base
        assert i.indices == indices_ref
        assert hash(i) == hash_ref
        assert i == v_ab
        assert str(i) == str_ref
        assert repr(i) == repr_ref

        # Vectors should not be sympified.
        with pytest.raises(TypeError):
            sympify(i)
