check operating system for absolute path test
This commit is contained in:
parent
a8cd963d46
commit
65e9a705d3
|
@ -112,7 +112,7 @@ jobs:
|
|||
- job: main_test
|
||||
displayName: Main Test
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
vmImage: windows-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
|
|
|
@ -448,7 +448,7 @@ namespace Emby.Server.Implementations.IO
|
|||
|
||||
public virtual void SetHidden(string path, bool isHidden)
|
||||
{
|
||||
if (OperatingSystem.Id != MediaBrowser.Model.System.OperatingSystemId.Windows)
|
||||
if (OperatingSystem.Id != OperatingSystemId.Windows)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -779,7 +779,7 @@ namespace Emby.Server.Implementations.IO
|
|||
|
||||
public virtual void SetExecutable(string path)
|
||||
{
|
||||
if (OperatingSystem.Id == MediaBrowser.Model.System.OperatingSystemId.Darwin)
|
||||
if (OperatingSystem.Id == OperatingSystemId.Darwin)
|
||||
{
|
||||
RunProcess("chmod", "+x \"" + path + "\"", Path.GetDirectoryName(path));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using AutoFixture;
|
||||
using AutoFixture.AutoMoq;
|
||||
using Emby.Server.Implementations.IO;
|
||||
using MediaBrowser.Model.System;
|
||||
using Xunit;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.Tests.IO
|
||||
|
@ -26,7 +28,16 @@ namespace Jellyfin.Server.Implementations.Tests.IO
|
|||
string expectedAbsolutePath)
|
||||
{
|
||||
var generatedPath = _sut.MakeAbsolutePath(folderPath, filePath);
|
||||
Assert.Equal(expectedAbsolutePath, generatedPath);
|
||||
|
||||
if (MediaBrowser.Common.System.OperatingSystem.Id == OperatingSystemId.Windows)
|
||||
{
|
||||
var windowsPath = "d:" + generatedPath.Replace('/', '\\');
|
||||
Assert.Equal(expectedAbsolutePath, windowsPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal(expectedAbsolutePath, generatedPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user