import nose.tools
from pycalphad import Database
from sympy import SympifyError

@nose.tools.raises(SympifyError)
def test_tdb_popen_exploit():
    "Prevent execution of arbitrary code using Popen."
    tdb_exploit_string = \
        """
        PARAMETER G(L12_FCC,AL,CR,NI:NI;0)
        298.15 [].__class__.__base__.__subclasses__()[158]('/bin/ls'); 6000 N !
        """
    Database(tdb_exploit_string)

import nose.tools
from pycalphad import Database

@nose.tools.raises(ValueError, TypeError)
def test_tdb_popen_exploit():
    "Prevent execution of arbitrary code using Popen."
    tdb_exploit_string = \
        """
        PARAMETER G(L12_FCC,AL,CR,NI:NI;0)
        298.15 [].__class__.__base__.__subclasses__()[158]('/bin/ls'); 6000 N !
        """
    Database(tdb_exploit_string)

Fix unit test for py26
Fix unit test for py26

  import nose.tools
  from pycalphad import Database
- from sympy import SympifyError
  
- @nose.tools.raises(SympifyError)
+ @nose.tools.raises(ValueError, TypeError)
  def test_tdb_popen_exploit():
      "Prevent execution of arbitrary code using Popen."
      tdb_exploit_string = \
          """
          PARAMETER G(L12_FCC,AL,CR,NI:NI;0)
          298.15 [].__class__.__base__.__subclasses__()[158]('/bin/ls'); 6000 N !
          """
      Database(tdb_exploit_string)
  
Fix unit test for py26
## Code Before:
import nose.tools
from pycalphad import Database
from sympy import SympifyError

@nose.tools.raises(SympifyError)
def test_tdb_popen_exploit():
    "Prevent execution of arbitrary code using Popen."
    tdb_exploit_string = \
        """
        PARAMETER G(L12_FCC,AL,CR,NI:NI;0)
        298.15 [].__class__.__base__.__subclasses__()[158]('/bin/ls'); 6000 N !
        """
    Database(tdb_exploit_string)

## Instruction:
Fix unit test for py26
## Code After:
import nose.tools
from pycalphad import Database

@nose.tools.raises(ValueError, TypeError)
def test_tdb_popen_exploit():
    "Prevent execution of arbitrary code using Popen."
    tdb_exploit_string = \
        """
        PARAMETER G(L12_FCC,AL,CR,NI:NI;0)
        298.15 [].__class__.__base__.__subclasses__()[158]('/bin/ls'); 6000 N !
        """
    Database(tdb_exploit_string)
