Skip to content

Commit

Permalink
Add Pypi Dev parsing test (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
grvillic authored Feb 1, 2022
1 parent 2956bdb commit e604b03
Showing 1 changed file with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,28 @@ public class PythonVersionTests
[TestMethod]
public void TestBasicVersionConstruction()
{
PythonVersion pythonVersion = new PythonVersion("4!3.2.1.1rc2.post99.dev2");
var pythonVersion = new PythonVersion("4!3.2.1.1rc2.post99.dev2");

Assert.AreEqual(pythonVersion.Epoch, 4);
Assert.AreEqual(pythonVersion.Release, "3.2.1.1");
Assert.AreEqual(pythonVersion.PreReleaseLabel, "rc");
Assert.AreEqual(pythonVersion.PostNumber, 99);
Assert.AreEqual(pythonVersion.DevNumber, 2);
Assert.AreEqual(4, pythonVersion.Epoch);
Assert.AreEqual("3.2.1.1", pythonVersion.Release);
Assert.AreEqual("rc", pythonVersion.PreReleaseLabel);
Assert.AreEqual(99, pythonVersion.PostNumber);
Assert.AreEqual("dev", pythonVersion.DevLabel);
Assert.AreEqual(2, pythonVersion.DevNumber);
}

[TestMethod]
public void TestDefaultDevVersionConstruction()
{
var pythonVersion = new PythonVersion("4!3.2.1.1rc2.post90.dev");

var newPythonVersion = new PythonVersion("0.3m1");
Assert.AreEqual(4, pythonVersion.Epoch);
Assert.AreEqual("3.2.1.1", pythonVersion.Release);
Assert.AreEqual("rc", pythonVersion.PreReleaseLabel);
Assert.AreEqual(2, pythonVersion.PreReleaseNumber);
Assert.AreEqual(90, pythonVersion.PostNumber);
Assert.AreEqual("dev", pythonVersion.DevLabel);
Assert.AreEqual(0, pythonVersion.DevNumber);
}

[TestMethod]
Expand Down

0 comments on commit e604b03

Please sign in to comment.